Class: Twilio::REST::Numbers::V2::BulkHostedNumberOrderContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, bulk_hosting_sid) ⇒ BulkHostedNumberOrderContext

Initialize the BulkHostedNumberOrderContext

Parameters:

  • version (Version)

    Version that contains the resource

  • bulk_hosting_sid (String)

    A 34 character string that uniquely identifies this BulkHostedNumberOrder.



69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 69

def initialize(version, bulk_hosting_sid)
    super(version)

    # Path Solution
    @solution = { bulk_hosting_sid: bulk_hosting_sid,  }
    @uri = "/HostedNumber/Orders/Bulk/#{@solution[:bulk_hosting_sid]}"

    
end

Instance Method Details

#fetch(order_status: :unset) ⇒ BulkHostedNumberOrderInstance

Fetch the BulkHostedNumberOrderInstance

Parameters:

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 82

def fetch(
    order_status: :unset
)

    params = Twilio::Values.of({
        'OrderStatus' => order_status,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    BulkHostedNumberOrderInstance.new(
        @version,
        payload,
        bulk_hosting_sid: @solution[:bulk_hosting_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



113
114
115
116
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 113

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Numbers.V2.BulkHostedNumberOrderContext #{context}>"
end

#to_sObject

Provide a user friendly representation



106
107
108
109
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 106

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Numbers.V2.BulkHostedNumberOrderContext #{context}>"
end