Class: Plivo::Resources::EndpointInterface
- Inherits:
-
Base::ResourceInterface
- Object
- Base::ResourceInterface
- Plivo::Resources::EndpointInterface
- Defined in:
- lib/plivo/resources/endpoints.rb
Constant Summary
Constants included from Utils
Instance Method Summary collapse
- #create(username, password, alias_, app_id = nil) ⇒ Object
- #delete(endpoint_id) ⇒ Object
- #each ⇒ Object
- #get(endpoint_id) ⇒ Object
-
#initialize(client, resource_list_json = nil) ⇒ EndpointInterface
constructor
A new instance of EndpointInterface.
- #list ⇒ Object
- #update(endpoint_id, options = nil) ⇒ Object
Methods included from Utils
expected_type?, expected_value?, raise_invalid_request, valid_account?, valid_mainaccount?, valid_param?, valid_signature?, valid_subaccount?
Constructor Details
#initialize(client, resource_list_json = nil) ⇒ EndpointInterface
Returns a new instance of EndpointInterface.
69 70 71 72 73 74 |
# File 'lib/plivo/resources/endpoints.rb', line 69 def initialize(client, resource_list_json = nil) @_name = 'Endpoint' @_resource_type = Endpoint @_identifier_string = 'endpoint_id' super end |
Instance Method Details
#create(username, password, alias_, app_id = nil) ⇒ Object
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 |
# File 'lib/plivo/resources/endpoints.rb', line 68 class EndpointInterface < Base::ResourceInterface def initialize(client, resource_list_json = nil) @_name = 'Endpoint' @_resource_type = Endpoint @_identifier_string = 'endpoint_id' super end # @param [String] endpoint_id def get(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) perform_get(endpoint_id) end # @param [String] username # @param [String] password # @param [String] alias_ # @param [String] app_id def create(username, password, alias_, app_id = nil) valid_param?(:username, username, [String, Symbol], true) valid_param?(:password, password, [String, Symbol], true) valid_param?(:alias, alias_, [String, Symbol], true) params = { username: username, password: password, alias: alias_ } params[:app_id] = app_id unless app_id.nil? perform_create(params) end def list perform_list end def each endpoint_list = list endpoint_list[:objects].each { |endpoint| yield endpoint } end # @param [String] endpoint_id # @param [Hash] options # @option options [String] :password The password for your endpoint username. # @option options [String] :alias Alias for this endpoint # @option options [String] :app_id The app_id of the application that is to be attached to this endpoint. If app_id is not specified, then the endpoint does not point to any application. def update(endpoint_id, = nil) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).update() end # @param [String] endpoint_id def delete(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).delete end end |
#delete(endpoint_id) ⇒ Object
123 124 125 126 127 |
# File 'lib/plivo/resources/endpoints.rb', line 123 def delete(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).delete end |
#each ⇒ Object
106 107 108 109 |
# File 'lib/plivo/resources/endpoints.rb', line 106 def each endpoint_list = list endpoint_list[:objects].each { |endpoint| yield endpoint } end |
#get(endpoint_id) ⇒ Object
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 |
# File 'lib/plivo/resources/endpoints.rb', line 68 class EndpointInterface < Base::ResourceInterface def initialize(client, resource_list_json = nil) @_name = 'Endpoint' @_resource_type = Endpoint @_identifier_string = 'endpoint_id' super end # @param [String] endpoint_id def get(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) perform_get(endpoint_id) end # @param [String] username # @param [String] password # @param [String] alias_ # @param [String] app_id def create(username, password, alias_, app_id = nil) valid_param?(:username, username, [String, Symbol], true) valid_param?(:password, password, [String, Symbol], true) valid_param?(:alias, alias_, [String, Symbol], true) params = { username: username, password: password, alias: alias_ } params[:app_id] = app_id unless app_id.nil? perform_create(params) end def list perform_list end def each endpoint_list = list endpoint_list[:objects].each { |endpoint| yield endpoint } end # @param [String] endpoint_id # @param [Hash] options # @option options [String] :password The password for your endpoint username. # @option options [String] :alias Alias for this endpoint # @option options [String] :app_id The app_id of the application that is to be attached to this endpoint. If app_id is not specified, then the endpoint does not point to any application. def update(endpoint_id, = nil) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).update() end # @param [String] endpoint_id def delete(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).delete end end |
#list ⇒ Object
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 |
# File 'lib/plivo/resources/endpoints.rb', line 68 class EndpointInterface < Base::ResourceInterface def initialize(client, resource_list_json = nil) @_name = 'Endpoint' @_resource_type = Endpoint @_identifier_string = 'endpoint_id' super end # @param [String] endpoint_id def get(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) perform_get(endpoint_id) end # @param [String] username # @param [String] password # @param [String] alias_ # @param [String] app_id def create(username, password, alias_, app_id = nil) valid_param?(:username, username, [String, Symbol], true) valid_param?(:password, password, [String, Symbol], true) valid_param?(:alias, alias_, [String, Symbol], true) params = { username: username, password: password, alias: alias_ } params[:app_id] = app_id unless app_id.nil? perform_create(params) end def list perform_list end def each endpoint_list = list endpoint_list[:objects].each { |endpoint| yield endpoint } end # @param [String] endpoint_id # @param [Hash] options # @option options [String] :password The password for your endpoint username. # @option options [String] :alias Alias for this endpoint # @option options [String] :app_id The app_id of the application that is to be attached to this endpoint. If app_id is not specified, then the endpoint does not point to any application. def update(endpoint_id, = nil) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).update() end # @param [String] endpoint_id def delete(endpoint_id) valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true) Endpoint.new(@_client, resource_id: endpoint_id).delete end end |