|
| 1 | +## |
| 2 | +# This code was generated by |
| 3 | +# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ |
| 4 | +# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ |
| 5 | +# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ |
| 6 | +# |
| 7 | +# Twilio - Trusthub |
| 8 | +# This is the public Twilio REST API. |
| 9 | +# |
| 10 | +# NOTE: This class is auto generated by OpenAPI Generator. |
| 11 | +# https://openapi-generator.tech |
| 12 | +# Do not edit the class manually. |
| 13 | +# |
| 14 | + |
| 15 | + |
| 16 | +module Twilio |
| 17 | + module REST |
| 18 | + class Trusthub < TrusthubBase |
| 19 | + class V1 < Version |
| 20 | + class ComplianceInquiriesList < ListResource |
| 21 | + ## |
| 22 | + # Initialize the ComplianceInquiriesList |
| 23 | + # @param [Version] version Version that contains the resource |
| 24 | + # @return [ComplianceInquiriesList] ComplianceInquiriesList |
| 25 | + def initialize(version) |
| 26 | + super(version) |
| 27 | + # Path Solution |
| 28 | + @solution = { } |
| 29 | + @uri = "/ComplianceInquiries/Customers/Initialize" |
| 30 | + |
| 31 | + end |
| 32 | + ## |
| 33 | + # Create the ComplianceInquiriesInstance |
| 34 | + # @param [String] primary_profile_sid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. |
| 35 | + # @return [ComplianceInquiriesInstance] Created ComplianceInquiriesInstance |
| 36 | + def create( |
| 37 | + primary_profile_sid: nil |
| 38 | + ) |
| 39 | + |
| 40 | + data = Twilio::Values.of({ |
| 41 | + 'PrimaryProfileSid' => primary_profile_sid, |
| 42 | + }) |
| 43 | + |
| 44 | + payload = @version.create('POST', @uri, data: data) |
| 45 | + ComplianceInquiriesInstance.new( |
| 46 | + @version, |
| 47 | + payload, |
| 48 | + ) |
| 49 | + end |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + # Provide a user friendly representation |
| 55 | + def to_s |
| 56 | + '#<Twilio.Trusthub.V1.ComplianceInquiriesList>' |
| 57 | + end |
| 58 | + end |
| 59 | + |
| 60 | + |
| 61 | + class ComplianceInquiriesContext < InstanceContext |
| 62 | + ## |
| 63 | + # Initialize the ComplianceInquiriesContext |
| 64 | + # @param [Version] version Version that contains the resource |
| 65 | + # @param [String] customer_id The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. |
| 66 | + # @return [ComplianceInquiriesContext] ComplianceInquiriesContext |
| 67 | + def initialize(version, customer_id) |
| 68 | + super(version) |
| 69 | + |
| 70 | + # Path Solution |
| 71 | + @solution = { customer_id: customer_id, } |
| 72 | + @uri = "/ComplianceInquiries/Customers/#{@solution[:customer_id]}/Initialize" |
| 73 | + |
| 74 | + |
| 75 | + end |
| 76 | + ## |
| 77 | + # Update the ComplianceInquiriesInstance |
| 78 | + # @param [String] primary_profile_sid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. |
| 79 | + # @return [ComplianceInquiriesInstance] Updated ComplianceInquiriesInstance |
| 80 | + def update( |
| 81 | + primary_profile_sid: nil |
| 82 | + ) |
| 83 | + |
| 84 | + data = Twilio::Values.of({ |
| 85 | + 'PrimaryProfileSid' => primary_profile_sid, |
| 86 | + }) |
| 87 | + |
| 88 | + payload = @version.update('POST', @uri, data: data) |
| 89 | + ComplianceInquiriesInstance.new( |
| 90 | + @version, |
| 91 | + payload, |
| 92 | + customer_id: @solution[:customer_id], |
| 93 | + ) |
| 94 | + end |
| 95 | + |
| 96 | + |
| 97 | + ## |
| 98 | + # Provide a user friendly representation |
| 99 | + def to_s |
| 100 | + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') |
| 101 | + "#<Twilio.Trusthub.V1.ComplianceInquiriesContext #{context}>" |
| 102 | + end |
| 103 | + |
| 104 | + ## |
| 105 | + # Provide a detailed, user friendly representation |
| 106 | + def inspect |
| 107 | + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') |
| 108 | + "#<Twilio.Trusthub.V1.ComplianceInquiriesContext #{context}>" |
| 109 | + end |
| 110 | + end |
| 111 | + |
| 112 | + class ComplianceInquiriesPage < Page |
| 113 | + ## |
| 114 | + # Initialize the ComplianceInquiriesPage |
| 115 | + # @param [Version] version Version that contains the resource |
| 116 | + # @param [Response] response Response from the API |
| 117 | + # @param [Hash] solution Path solution for the resource |
| 118 | + # @return [ComplianceInquiriesPage] ComplianceInquiriesPage |
| 119 | + def initialize(version, response, solution) |
| 120 | + super(version, response) |
| 121 | + |
| 122 | + # Path Solution |
| 123 | + @solution = solution |
| 124 | + end |
| 125 | + |
| 126 | + ## |
| 127 | + # Build an instance of ComplianceInquiriesInstance |
| 128 | + # @param [Hash] payload Payload response from the API |
| 129 | + # @return [ComplianceInquiriesInstance] ComplianceInquiriesInstance |
| 130 | + def get_instance(payload) |
| 131 | + ComplianceInquiriesInstance.new(@version, payload) |
| 132 | + end |
| 133 | + |
| 134 | + ## |
| 135 | + # Provide a user friendly representation |
| 136 | + def to_s |
| 137 | + '<Twilio.Trusthub.V1.ComplianceInquiriesPage>' |
| 138 | + end |
| 139 | + end |
| 140 | + class ComplianceInquiriesInstance < InstanceResource |
| 141 | + ## |
| 142 | + # Initialize the ComplianceInquiriesInstance |
| 143 | + # @param [Version] version Version that contains the resource |
| 144 | + # @param [Hash] payload payload that contains response from Twilio |
| 145 | + # @param [String] account_sid The SID of the |
| 146 | + # {Account}[https://www.twilio.com/docs/iam/api/account] that created this ComplianceInquiries |
| 147 | + # resource. |
| 148 | + # @param [String] sid The SID of the Call resource to fetch. |
| 149 | + # @return [ComplianceInquiriesInstance] ComplianceInquiriesInstance |
| 150 | + def initialize(version, payload , customer_id: nil) |
| 151 | + super(version) |
| 152 | + |
| 153 | + # Marshaled Properties |
| 154 | + @properties = { |
| 155 | + 'inquiry_id' => payload['inquiry_id'], |
| 156 | + 'inquiry_session_token' => payload['inquiry_session_token'], |
| 157 | + 'customer_id' => payload['customer_id'], |
| 158 | + 'url' => payload['url'], |
| 159 | + } |
| 160 | + |
| 161 | + # Context |
| 162 | + @instance_context = nil |
| 163 | + @params = { 'customer_id' => customer_id || @properties['customer_id'] , } |
| 164 | + end |
| 165 | + |
| 166 | + ## |
| 167 | + # Generate an instance context for the instance, the context is capable of |
| 168 | + # performing various actions. All instance actions are proxied to the context |
| 169 | + # @return [ComplianceInquiriesContext] CallContext for this CallInstance |
| 170 | + def context |
| 171 | + unless @instance_context |
| 172 | + @instance_context = ComplianceInquiriesContext.new(@version , @params['customer_id']) |
| 173 | + end |
| 174 | + @instance_context |
| 175 | + end |
| 176 | + |
| 177 | + ## |
| 178 | + # @return [String] The unique ID used to start an embedded compliance registration session. |
| 179 | + def inquiry_id |
| 180 | + @properties['inquiry_id'] |
| 181 | + end |
| 182 | + |
| 183 | + ## |
| 184 | + # @return [String] The session token used to start an embedded compliance registration session. |
| 185 | + def inquiry_session_token |
| 186 | + @properties['inquiry_session_token'] |
| 187 | + end |
| 188 | + |
| 189 | + ## |
| 190 | + # @return [String] The CustomerID matching the Customer Profile that should be resumed or resubmitted for editing. |
| 191 | + def customer_id |
| 192 | + @properties['customer_id'] |
| 193 | + end |
| 194 | + |
| 195 | + ## |
| 196 | + # @return [String] The URL of this resource. |
| 197 | + def url |
| 198 | + @properties['url'] |
| 199 | + end |
| 200 | + |
| 201 | + ## |
| 202 | + # Update the ComplianceInquiriesInstance |
| 203 | + # @param [String] primary_profile_sid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. |
| 204 | + # @return [ComplianceInquiriesInstance] Updated ComplianceInquiriesInstance |
| 205 | + def update( |
| 206 | + primary_profile_sid: nil |
| 207 | + ) |
| 208 | + |
| 209 | + context.update( |
| 210 | + primary_profile_sid: primary_profile_sid, |
| 211 | + ) |
| 212 | + end |
| 213 | + |
| 214 | + ## |
| 215 | + # Provide a user friendly representation |
| 216 | + def to_s |
| 217 | + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") |
| 218 | + "<Twilio.Trusthub.V1.ComplianceInquiriesInstance #{values}>" |
| 219 | + end |
| 220 | + |
| 221 | + ## |
| 222 | + # Provide a detailed, user friendly representation |
| 223 | + def inspect |
| 224 | + values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") |
| 225 | + "<Twilio.Trusthub.V1.ComplianceInquiriesInstance #{values}>" |
| 226 | + end |
| 227 | + end |
| 228 | + |
| 229 | + end |
| 230 | + end |
| 231 | + end |
| 232 | +end |
0 commit comments