-
Notifications
You must be signed in to change notification settings - Fork 11
VAPI-3162-REFER #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VAPI-3162-REFER #211
Changes from 13 commits
3961094
63d9927
06f9afb
75fc16f
51c8b79
9d29700
b54f869
539a192
d33a62a
be3de02
c367380
cbcfb9c
9630fe1
d4618a0
09845f7
7595660
f9e1687
dcf2409
5da9848
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||
| module Bandwidth | ||||||||||||||||||
| module Bxml | ||||||||||||||||||
| class Refer < Bandwidth::Bxml::NestableVerb | ||||||||||||||||||
| def initialize(sip_uri, attributes = {}) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| super('Refer', nil, [sip_uri], attributes) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this is casted to an array in the super constructor, no need to here |
||||||||||||||||||
| @attribute_map = { | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| refer_complete_url: 'referCompleteUrl', | ||||||||||||||||||
| refer_complete_method: 'referCompleteMethod', | ||||||||||||||||||
| tag: 'tag' | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we get annotations for these, we typically copy the description from the docs page and define, their optionality and type, see the other verbs for how it looks |
||||||||||||||||||
| } | ||||||||||||||||||
| end | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
other nestable verbs have functions to update their nested verbs, we should add one here. It doesn't need to match the others in the way they append to the list, it can probably just set |
||||||||||||||||||
| end | ||||||||||||||||||
| end | ||||||||||||||||||
| end | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| =begin | ||
| #Bandwidth | ||
| #Bandwidth's Communication APIs | ||
| The version of the OpenAPI document: 1.0.0 | ||
| Contact: letstalk@bandwidth.com | ||
| Generated by: https://openapi-generator.tech | ||
| Generator version: 7.17.0 | ||
| =end | ||
|
|
||
| require 'date' | ||
| require 'time' | ||
|
|
||
| module Bandwidth | ||
| #BXML <Refer> verb model. Sends a SIP REFER for an inbound SIP URI call | ||
| class Refer < ApiModelBase | ||
| attr_accessor :refer_complete_url | ||
| attr_accessor :refer_complete_method | ||
| attr_accessor :tag | ||
| attr_accessor :sip_uri | ||
|
|
||
| def self.attribute_map | ||
| { | ||
| :'refer_complete_url' => :'referCompleteUrl', | ||
| :'refer_complete_method' => :'referCompleteMethod', | ||
| :'tag' => :'tag', | ||
| :'sip_uri' => :'sipUri' | ||
| } | ||
| end | ||
|
|
||
| def self.acceptable_attribute_map | ||
| attribute_map | ||
| end | ||
|
|
||
| def self.acceptable_attributes | ||
| acceptable_attribute_map.values | ||
| end | ||
|
|
||
| def self.openapi_types | ||
| { | ||
| :'refer_complete_url' => :'String', | ||
| :'refer_complete_method' => :'ReferCompleteMethodEnum', | ||
| :'tag' => :'String', | ||
| :'sip_uri' => :'SipUri' | ||
| } | ||
| end | ||
|
|
||
| def self.openapi_nullable | ||
| Set.new([:'refer_complete_url', :'refer_complete_method', :'tag']) | ||
| end | ||
|
|
||
| def initialize(attributes = {}) | ||
| raise ArgumentError, "attributes must be a Hash" unless attributes.is_a?(Hash) | ||
|
|
||
| acceptable_attribute_map = self.class.acceptable_attribute_map | ||
| attributes = attributes.each_with_object({}) do |(k, v), h| | ||
| raise ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Refer`." unless acceptable_attribute_map.key?(k.to_sym) | ||
| h[k.to_sym] = v | ||
| end | ||
|
|
||
| self.refer_complete_url = attributes[:'refer_complete_url'] if attributes.key?(:'refer_complete_url') | ||
| self.refer_complete_method = attributes[:'refer_complete_method'] if attributes.key?(:'refer_complete_method') | ||
| self.tag = attributes[:'tag'] if attributes.key?(:'tag') | ||
| self.sip_uri = attributes[:'sip_uri'] if attributes.key?(:'sip_uri') | ||
|
|
||
| # required nested destination | ||
| raise ArgumentError, "`sip_uri` is required for Bandwidth::Refer" if self.sip_uri.nil? | ||
| # optional validation | ||
| if !self.refer_complete_method.nil? | ||
| ReferCompleteMethodEnum.build_from_hash(self.refer_complete_method) | ||
| end | ||
| if !self.tag.nil? && self.tag.length > 256 | ||
| raise ArgumentError, "`tag` max length is 256" | ||
| end | ||
| end | ||
|
|
||
| def self.build_from_hash(attributes) | ||
| return nil unless attributes.is_a?(Hash) | ||
| attributes = attributes.transform_keys(&:to_sym) | ||
| transformed_hash = {} | ||
| openapi_types.each_pair do |key, type| | ||
| if attributes.key?(attribute_map[key]) && !attributes[attribute_map[key]].nil? | ||
| transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]]) | ||
| end | ||
| end | ||
| new(transformed_hash) | ||
| end | ||
|
|
||
| def to_hash | ||
| hash = {} | ||
| self.class.attribute_map.each_pair do |attr, param| | ||
| value = send(attr) | ||
| if value.nil? | ||
| is_nullable = self.class.openapi_nullable.include?(attr) | ||
| next unless is_nullable && instance_variable_defined?(:"@#{attr}") | ||
| end | ||
| hash[param] = _to_hash(value) | ||
| end | ||
| hash | ||
| end | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| =begin | ||
| #Bandwidth | ||
| #Bandwidth's Communication APIs | ||
| The version of the OpenAPI document: 1.0.0 | ||
| Contact: letstalk@bandwidth.com | ||
| Generated by: https://openapi-generator.tech | ||
| Generator version: 7.17.0 | ||
| =end | ||
|
|
||
| require 'date' | ||
| require 'time' | ||
|
|
||
| module Bandwidth | ||
| class ReferCallStatusEnum | ||
| SUCCESS = "success".freeze | ||
| FAILURE = "failure".freeze | ||
|
|
||
| def self.all_vars | ||
| @all_vars ||= [SUCCESS, FAILURE].freeze | ||
| end | ||
|
|
||
| # Builds the enum from string | ||
| # @param [String] The enum value in the form of the string | ||
| # @return [String] The enum value | ||
| def self.build_from_hash(value) | ||
| new.build_from_hash(value) | ||
| end | ||
|
|
||
| # Builds the enum from string | ||
| # @param [String] The enum value in the form of the string | ||
| # @return [String] The enum value | ||
| def build_from_hash(value) | ||
| return value if ReferCallStatusEnum.all_vars.include?(value) | ||
| raise "Invalid ENUM value #{value} for class #ReferCallStatusEnum" | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is autogenerated, it shouldn't have any changes