Class: Courier::Models::ProviderPatchParams::Patch
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Courier::Models::ProviderPatchParams::Patch
- Defined in:
- lib/courier/models/provider_patch_params.rb,
sig/courier/models/provider_patch_params.rbs
Defined Under Namespace
Modules: Op
Instance Attribute Summary collapse
-
#from ⇒ String?
JSON Pointer to the source field for
moveandcopy. -
#op ⇒ Symbol, Courier::Models::ProviderPatchParams::Patch::Op
The operation to perform.
-
#path ⇒ String
JSON Pointer to the field to operate on, such as
/settings/api_key. -
#value ⇒ Object?
The value for
add,replaceandtest.
Instance Method Summary collapse
-
#initialize(op:, path:, from: nil, value: nil) ⇒ Patch
constructor
One JSON Patch (RFC 6902) operation.
- #to_hash ⇒ { op: Courier::Models::ProviderPatchParams::Patch::op, path: String, from: String, value: top }
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(op:, path:, from: nil, value: nil) ⇒ Patch
One JSON Patch (RFC 6902) operation.
36 37 38 39 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 |
# File 'lib/courier/models/provider_patch_params.rb', line 36 class Patch < Courier::Internal::Type::BaseModel # @!attribute op # The operation to perform. # # @return [Symbol, Courier::Models::ProviderPatchParams::Patch::Op] required :op, enum: -> { Courier::ProviderPatchParams::Patch::Op } # @!attribute path # JSON Pointer to the field to operate on, such as `/settings/api_key`. # # @return [String] required :path, String # @!attribute from # JSON Pointer to the source field for `move` and `copy`. # # @return [String, nil] optional :from, String # @!attribute value # The value for `add`, `replace` and `test`. Any JSON value. # # @return [Object, nil] optional :value, Courier::Internal::Type::Unknown # @!method initialize(op:, path:, from: nil, value: nil) # One JSON Patch (RFC 6902) operation. # # @param op [Symbol, Courier::Models::ProviderPatchParams::Patch::Op] The operation to perform. # # @param path [String] JSON Pointer to the field to operate on, such as `/settings/api_key`. # # @param from [String] JSON Pointer to the source field for `move` and `copy`. # # @param value [Object] The value for `add`, `replace` and `test`. Any JSON value. # The operation to perform. # # @see Courier::Models::ProviderPatchParams::Patch#op module Op extend Courier::Internal::Type::Enum ADD = :add REMOVE = :remove REPLACE = :replace MOVE = :move COPY = :copy TEST = :test # @!method self.values # @return [Array<Symbol>] end end |
Instance Attribute Details
#from ⇒ String?
JSON Pointer to the source field for move and copy.
53 |
# File 'lib/courier/models/provider_patch_params.rb', line 53 optional :from, String |
#op ⇒ Symbol, Courier::Models::ProviderPatchParams::Patch::Op
The operation to perform.
41 |
# File 'lib/courier/models/provider_patch_params.rb', line 41 required :op, enum: -> { Courier::ProviderPatchParams::Patch::Op } |
#path ⇒ String
JSON Pointer to the field to operate on, such as /settings/api_key.
47 |
# File 'lib/courier/models/provider_patch_params.rb', line 47 required :path, String |
#value ⇒ Object?
The value for add, replace and test. Any JSON value.
59 |
# File 'lib/courier/models/provider_patch_params.rb', line 59 optional :value, Courier::Internal::Type::Unknown |
Instance Method Details
#to_hash ⇒ { op: Courier::Models::ProviderPatchParams::Patch::op, path: String, from: String, value: top }
55 56 57 58 59 60 |
# File 'sig/courier/models/provider_patch_params.rbs', line 55 def to_hash: -> { op: Courier::Models::ProviderPatchParams::Patch::op, path: String, from: String, value: top } |