Class: Plivo::Base::SecondaryResource
- Defined in:
- lib/plivo/base/resource.rb
Direct Known Subclasses
Resources::MultiPartyCallMember, Resources::MultiPartyCallParticipant
Constant Summary
Constants included from Utils
Instance Attribute Summary collapse
-
#secondary_id ⇒ Object
readonly
Returns the value of attribute secondary_id.
Attributes inherited from Resource
Instance Method Summary collapse
- #configure_secondary_options(options) ⇒ Object
- #configure_secondary_resource_uri ⇒ Object
-
#initialize(client, options = nil) ⇒ SecondaryResource
constructor
A new instance of SecondaryResource.
- #secondary_parse_and_set(resource_json) ⇒ Object
Methods included from Utils
GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, is_one_among_string_url?, multi_valid_param?, raise_invalid_request, valid_account?, valid_date_format?, valid_mainaccount?, valid_multiple_destination_integers?, valid_multiple_destination_nos?, valid_param?, valid_range?, valid_signature?, valid_signatureV3?, valid_subaccount?, valid_url?
Constructor Details
#initialize(client, options = nil) ⇒ SecondaryResource
Returns a new instance of SecondaryResource.
120 121 122 123 124 |
# File 'lib/plivo/base/resource.rb', line 120 def initialize(client, = nil) super () if configure_secondary_resource_uri end |
Instance Attribute Details
#secondary_id ⇒ Object (readonly)
Returns the value of attribute secondary_id.
119 120 121 |
# File 'lib/plivo/base/resource.rb', line 119 def secondary_id @secondary_id end |
Instance Method Details
#configure_secondary_options(options) ⇒ Object
126 127 128 129 130 |
# File 'lib/plivo/base/resource.rb', line 126 def () valid_param?(:options, , Hash, false) @secondary_id = [:member_id] if .key?(:member_id) secondary_parse_and_set([:resource_json]) if .key?(:resource_json) end |
#configure_secondary_resource_uri ⇒ Object
140 141 142 143 144 145 |
# File 'lib/plivo/base/resource.rb', line 140 def configure_secondary_resource_uri to_join = @secondary_id ? [@_client.auth_id, @_name, @id, @_secondary_name, @secondary_id] : [@_client.auth_id, @_name, @id] to_join = ['', 'v1', 'Account'] << to_join to_join << '' @_resource_uri = to_join.join('/') end |
#secondary_parse_and_set(resource_json) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/plivo/base/resource.rb', line 132 def secondary_parse_and_set(resource_json) return unless resource_json valid_param?(:resource_json, resource_json, Hash, true) return unless @_secondary_identifier_string && (resource_json.key? @_secondary_identifier_string) @secondary_id = resource_json[@_secondary_identifier_string] end |