lib/telnyx/telephony_credential.rb in telnyx-3.0.3 vs lib/telnyx/telephony_credential.rb in telnyx-3.0.4
- old
+ new
@@ -14,15 +14,16 @@
path: %W[actions #{action}],
operations: [:create],
instance_methods: { create: action }
end
- %w[token].each do |action|
- nested_resource_class_methods action,
- path: %W[#{action}],
- operations: [:create],
- instance_methods: { create: action }
+ # Manually create JSON response object from JWT when calling token
+ def create_token(params = {}, opts = {})
+ url = "#{resource_url}/token"
+ resp, opts = request(:post, url, params, opts)
+ Util.convert_to_telnyx_object(resp.data, opts)
end
+
# Additional action to list tags
def self.tags(params = {}, opts = {})
opts = Util.normalize_opts(opts)
resp, opts = request(:get, "/v2/telephony_credentials/tags", params, opts)
ListObject.construct_from(resp.data, opts)