Class: Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule
- Defined in:
- lib/telnyx/models/ai/assistants/canary_deploy_response.rb
Defined Under Namespace
Instance Attribute Summary collapse
- #match ⇒ Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match>?
-
#serve ⇒ Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve
What a rule serves when matched.
Instance Method Summary collapse
-
#initialize(version_id:, weight:) ⇒ Object
constructor
One slot in a percentage rollout.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(version_id:, weight:) ⇒ Object
One slot in a percentage rollout.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/telnyx/models/ai/assistants/canary_deploy_response.rb', line 40 class Rule < Telnyx::Internal::Type::BaseModel # @!attribute serve # What a rule serves when matched. # # Exactly one of: # # - `version_id` — serve a specific version # - `rollout` — weighted random across versions; weights must sum to less than # 100, with the leftover routing to the main version # # @return [Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve] required :serve, -> { Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Serve } # @!attribute match # # @return [Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match>, nil] optional :match, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Match] } # @!method initialize(serve:, match: nil) # Some parameter documentations has been truncated, see # {Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule} for more details. # # A targeting rule: `match` clauses (AND) gate `serve`. # # An empty `match` is a catch-all (always fires). # # @param serve [Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve] What a rule serves when matched. # # @param match [Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match>] # @see Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule#serve class Serve < Telnyx::Internal::Type::BaseModel # @!attribute rollout # # @return [Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve::Rollout>, nil] optional :rollout, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Serve::Rollout] } # @!attribute version_id # # @return [String, nil] optional :version_id, String # @!method initialize(rollout: nil, version_id: nil) # What a rule serves when matched. # # Exactly one of: # # - `version_id` — serve a specific version # - `rollout` — weighted random across versions; weights must sum to less than # 100, with the leftover routing to the main version # # @param rollout [Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve::Rollout>] # @param version_id [String] class Rollout < Telnyx::Internal::Type::BaseModel # @!attribute version_id # # @return [String] required :version_id, String # @!attribute weight # # @return [Float] required :weight, Float # @!method initialize(version_id:, weight:) # One slot in a percentage rollout. # # @param version_id [String] # @param weight [Float] end end class Match < Telnyx::Internal::Type::BaseModel # @!attribute attribute # Attribute name from the routing context # # @return [String] required :attribute, String # @!attribute operator # Match operator # # @return [Symbol, Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match::Operator] required :operator, enum: -> { Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Match::Operator } # @!attribute values # # @return [Array<String>] required :values, Telnyx::Internal::Type::ArrayOf[String] # @!method initialize(attribute:, operator:, values:) # A single attribute/operator/values check. # # A clause matches when the routing context's value for `attribute` satisfies # `operator` against any of `values`. # # @param attribute [String] Attribute name from the routing context # # @param operator [Symbol, Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match::Operator] Match operator # # @param values [Array<String>] # Match operator # # @see Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match#operator module Operator extend Telnyx::Internal::Type::Enum IN = :in NOT_IN = :not_in STARTS_WITH = :starts_with # @!method self.values # @return [Array<Symbol>] end end end |
Instance Attribute Details
#match ⇒ Array<Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Match>?
56 57 |
# File 'lib/telnyx/models/ai/assistants/canary_deploy_response.rb', line 56 optional :match, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Match] } |
#serve ⇒ Telnyx::Models::AI::Assistants::CanaryDeployResponse::Rule::Serve
What a rule serves when matched.
Exactly one of:
-
‘version_id` — serve a specific version
-
‘rollout` — weighted random across versions; weights must sum to less than 100, with the leftover routing to the main version
51 |
# File 'lib/telnyx/models/ai/assistants/canary_deploy_response.rb', line 51 required :serve, -> { Telnyx::AI::Assistants::CanaryDeployResponse::Rule::Serve } |