|
| 1 | +r""" |
| 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 | +from typing import Any, Dict, Optional |
| 17 | +from twilio.base import values |
| 18 | +from twilio.base.instance_context import InstanceContext |
| 19 | +from twilio.base.instance_resource import InstanceResource |
| 20 | +from twilio.base.list_resource import ListResource |
| 21 | +from twilio.base.version import Version |
| 22 | + |
| 23 | + |
| 24 | +class ComplianceInquiriesInstance(InstanceResource): |
| 25 | + |
| 26 | + """ |
| 27 | + :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. |
| 28 | + :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. |
| 29 | + :ivar customer_id: The CustomerID matching the Customer Profile that should be resumed or resubmitted for editing. |
| 30 | + :ivar url: The URL of this resource. |
| 31 | + """ |
| 32 | + |
| 33 | + def __init__( |
| 34 | + self, |
| 35 | + version: Version, |
| 36 | + payload: Dict[str, Any], |
| 37 | + customer_id: Optional[str] = None, |
| 38 | + ): |
| 39 | + super().__init__(version) |
| 40 | + |
| 41 | + self.inquiry_id: Optional[str] = payload.get("inquiry_id") |
| 42 | + self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token") |
| 43 | + self.customer_id: Optional[str] = payload.get("customer_id") |
| 44 | + self.url: Optional[str] = payload.get("url") |
| 45 | + |
| 46 | + self._solution = { |
| 47 | + "customer_id": customer_id or self.customer_id, |
| 48 | + } |
| 49 | + self._context: Optional[ComplianceInquiriesContext] = None |
| 50 | + |
| 51 | + @property |
| 52 | + def _proxy(self) -> "ComplianceInquiriesContext": |
| 53 | + """ |
| 54 | + Generate an instance context for the instance, the context is capable of |
| 55 | + performing various actions. All instance actions are proxied to the context |
| 56 | +
|
| 57 | + :returns: ComplianceInquiriesContext for this ComplianceInquiriesInstance |
| 58 | + """ |
| 59 | + if self._context is None: |
| 60 | + self._context = ComplianceInquiriesContext( |
| 61 | + self._version, |
| 62 | + customer_id=self._solution["customer_id"], |
| 63 | + ) |
| 64 | + return self._context |
| 65 | + |
| 66 | + def update(self, primary_profile_sid: str) -> "ComplianceInquiriesInstance": |
| 67 | + """ |
| 68 | + Update the ComplianceInquiriesInstance |
| 69 | +
|
| 70 | + :param 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. |
| 71 | +
|
| 72 | + :returns: The updated ComplianceInquiriesInstance |
| 73 | + """ |
| 74 | + return self._proxy.update( |
| 75 | + primary_profile_sid=primary_profile_sid, |
| 76 | + ) |
| 77 | + |
| 78 | + async def update_async( |
| 79 | + self, primary_profile_sid: str |
| 80 | + ) -> "ComplianceInquiriesInstance": |
| 81 | + """ |
| 82 | + Asynchronous coroutine to update the ComplianceInquiriesInstance |
| 83 | +
|
| 84 | + :param 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. |
| 85 | +
|
| 86 | + :returns: The updated ComplianceInquiriesInstance |
| 87 | + """ |
| 88 | + return await self._proxy.update_async( |
| 89 | + primary_profile_sid=primary_profile_sid, |
| 90 | + ) |
| 91 | + |
| 92 | + def __repr__(self) -> str: |
| 93 | + """ |
| 94 | + Provide a friendly representation |
| 95 | +
|
| 96 | + :returns: Machine friendly representation |
| 97 | + """ |
| 98 | + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) |
| 99 | + return "<Twilio.Trusthub.V1.ComplianceInquiriesInstance {}>".format(context) |
| 100 | + |
| 101 | + |
| 102 | +class ComplianceInquiriesContext(InstanceContext): |
| 103 | + def __init__(self, version: Version, customer_id: str): |
| 104 | + """ |
| 105 | + Initialize the ComplianceInquiriesContext |
| 106 | +
|
| 107 | + :param version: Version that contains the resource |
| 108 | + :param 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. |
| 109 | + """ |
| 110 | + super().__init__(version) |
| 111 | + |
| 112 | + # Path Solution |
| 113 | + self._solution = { |
| 114 | + "customer_id": customer_id, |
| 115 | + } |
| 116 | + self._uri = "/ComplianceInquiries/Customers/{customer_id}/Initialize".format( |
| 117 | + **self._solution |
| 118 | + ) |
| 119 | + |
| 120 | + def update(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: |
| 121 | + """ |
| 122 | + Update the ComplianceInquiriesInstance |
| 123 | +
|
| 124 | + :param 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. |
| 125 | +
|
| 126 | + :returns: The updated ComplianceInquiriesInstance |
| 127 | + """ |
| 128 | + data = values.of( |
| 129 | + { |
| 130 | + "PrimaryProfileSid": primary_profile_sid, |
| 131 | + } |
| 132 | + ) |
| 133 | + |
| 134 | + payload = self._version.update( |
| 135 | + method="POST", |
| 136 | + uri=self._uri, |
| 137 | + data=data, |
| 138 | + ) |
| 139 | + |
| 140 | + return ComplianceInquiriesInstance( |
| 141 | + self._version, payload, customer_id=self._solution["customer_id"] |
| 142 | + ) |
| 143 | + |
| 144 | + async def update_async( |
| 145 | + self, primary_profile_sid: str |
| 146 | + ) -> ComplianceInquiriesInstance: |
| 147 | + """ |
| 148 | + Asynchronous coroutine to update the ComplianceInquiriesInstance |
| 149 | +
|
| 150 | + :param 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. |
| 151 | +
|
| 152 | + :returns: The updated ComplianceInquiriesInstance |
| 153 | + """ |
| 154 | + data = values.of( |
| 155 | + { |
| 156 | + "PrimaryProfileSid": primary_profile_sid, |
| 157 | + } |
| 158 | + ) |
| 159 | + |
| 160 | + payload = await self._version.update_async( |
| 161 | + method="POST", |
| 162 | + uri=self._uri, |
| 163 | + data=data, |
| 164 | + ) |
| 165 | + |
| 166 | + return ComplianceInquiriesInstance( |
| 167 | + self._version, payload, customer_id=self._solution["customer_id"] |
| 168 | + ) |
| 169 | + |
| 170 | + def __repr__(self) -> str: |
| 171 | + """ |
| 172 | + Provide a friendly representation |
| 173 | +
|
| 174 | + :returns: Machine friendly representation |
| 175 | + """ |
| 176 | + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) |
| 177 | + return "<Twilio.Trusthub.V1.ComplianceInquiriesContext {}>".format(context) |
| 178 | + |
| 179 | + |
| 180 | +class ComplianceInquiriesList(ListResource): |
| 181 | + def __init__(self, version: Version): |
| 182 | + """ |
| 183 | + Initialize the ComplianceInquiriesList |
| 184 | +
|
| 185 | + :param version: Version that contains the resource |
| 186 | +
|
| 187 | + """ |
| 188 | + super().__init__(version) |
| 189 | + |
| 190 | + self._uri = "/ComplianceInquiries/Customers/Initialize" |
| 191 | + |
| 192 | + def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: |
| 193 | + """ |
| 194 | + Create the ComplianceInquiriesInstance |
| 195 | +
|
| 196 | + :param 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. |
| 197 | +
|
| 198 | + :returns: The created ComplianceInquiriesInstance |
| 199 | + """ |
| 200 | + data = values.of( |
| 201 | + { |
| 202 | + "PrimaryProfileSid": primary_profile_sid, |
| 203 | + } |
| 204 | + ) |
| 205 | + |
| 206 | + payload = self._version.create( |
| 207 | + method="POST", |
| 208 | + uri=self._uri, |
| 209 | + data=data, |
| 210 | + ) |
| 211 | + |
| 212 | + return ComplianceInquiriesInstance(self._version, payload) |
| 213 | + |
| 214 | + async def create_async( |
| 215 | + self, primary_profile_sid: str |
| 216 | + ) -> ComplianceInquiriesInstance: |
| 217 | + """ |
| 218 | + Asynchronously create the ComplianceInquiriesInstance |
| 219 | +
|
| 220 | + :param 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. |
| 221 | +
|
| 222 | + :returns: The created ComplianceInquiriesInstance |
| 223 | + """ |
| 224 | + data = values.of( |
| 225 | + { |
| 226 | + "PrimaryProfileSid": primary_profile_sid, |
| 227 | + } |
| 228 | + ) |
| 229 | + |
| 230 | + payload = await self._version.create_async( |
| 231 | + method="POST", |
| 232 | + uri=self._uri, |
| 233 | + data=data, |
| 234 | + ) |
| 235 | + |
| 236 | + return ComplianceInquiriesInstance(self._version, payload) |
| 237 | + |
| 238 | + def get(self, customer_id: str) -> ComplianceInquiriesContext: |
| 239 | + """ |
| 240 | + Constructs a ComplianceInquiriesContext |
| 241 | +
|
| 242 | + :param 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. |
| 243 | + """ |
| 244 | + return ComplianceInquiriesContext(self._version, customer_id=customer_id) |
| 245 | + |
| 246 | + def __call__(self, customer_id: str) -> ComplianceInquiriesContext: |
| 247 | + """ |
| 248 | + Constructs a ComplianceInquiriesContext |
| 249 | +
|
| 250 | + :param 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. |
| 251 | + """ |
| 252 | + return ComplianceInquiriesContext(self._version, customer_id=customer_id) |
| 253 | + |
| 254 | + def __repr__(self) -> str: |
| 255 | + """ |
| 256 | + Provide a friendly representation |
| 257 | +
|
| 258 | + :returns: Machine friendly representation |
| 259 | + """ |
| 260 | + return "<Twilio.Trusthub.V1.ComplianceInquiriesList>" |
0 commit comments