|
| 1 | +# coding=utf-8 |
| 2 | +""" |
| 3 | +This code was generated by |
| 4 | +\ / _ _ _| _ _ |
| 5 | + | (_)\/(_)(_|\/| |(/_ v1.0.0 |
| 6 | + / / |
| 7 | +""" |
| 8 | + |
| 9 | +from twilio import deserialize |
| 10 | +from
8000
span> twilio import values |
| 11 | +from twilio.instance_resource import InstanceResource |
| 12 | +from twilio.list_resource import ListResource |
| 13 | +from twilio.page import Page |
| 14 | + |
| 15 | + |
| 16 | +class FeedbackList(ListResource): |
| 17 | + |
| 18 | + def __init__(self, version, account_sid, message_sid): |
| 19 | + """ |
| 20 | + Initialize the FeedbackList |
| 21 | + |
| 22 | + :param Version version: Version that contains the resource |
| 23 | + :param account_sid: The account_sid |
| 24 | + :param message_sid: The message_sid |
| 25 | + |
| 26 | + :returns: FeedbackList |
| 27 | + :rtype: FeedbackList |
| 28 | + """ |
| 29 | + super(FeedbackList, self).__init__(version) |
| 30 | + |
| 31 | + # Path Solution |
| 32 | + self._solution = { |
<
3D16
code> | 33 | + 'account_sid': account_sid, |
| 34 | + 'message_sid': message_sid, |
| 35 | + } |
| 36 | + self._uri = '/Accounts/{account_sid}/Messages/{message_sid}/Feedback.json'.format(**self._solution) |
| 37 | + |
| 38 | + def create(self, outcome=values.unset): |
| 39 | + """ |
| 40 | + Create a new FeedbackInstance |
| 41 | + |
| 42 | + :param feedback.outcome outcome: The outcome |
| 43 | + |
| 44 | + :returns: Newly created FeedbackInstance |
| 45 | + :rtype: FeedbackInstance |
| 46 | + """ |
| 47 | + data = values.of({ |
| 48 | + 'Outcome': outcome, |
| 49 | + }) |
| 50 | + |
| 51 | + payload = self._version.create( |
| 52 | + 'POST', |
| 53 | + self._uri, |
| 54 | + data=data, |
| 55 | + ) |
| 56 | + |
| 57 | + return FeedbackInstance( |
| 58 | + self._version, |
| 59 | + payload, |
| 60 | + account_sid=self._solution['account_sid'], |
| 61 | + message_sid=self._solution['message_sid'], |
| 62 | + ) |
| 63 | + |
| 64 | + def __repr__(self): |
| 65 | + """ |
| 66 | + Provide a friendly representation |
| 67 | + |
| 68 | + :returns: Machine friendly representation |
| 69 | + :rtype: str |
| 70 | + """ |
| 71 | + return '<Twilio.Api.V2010.FeedbackList>' |
| 72 | + |
| 73 | + |
| 74 | +class FeedbackPage(Page): |
| 75 | + |
| 76 | + def __init__(self, version, response, solution): |
| 77 | + """ |
| 78 | + Initialize the FeedbackPage |
| 79 | + |
| 80 | + :param Version version: Version that contains the resource |
| 81 | + :param Response response: Response from the API |
| 82 | + :param account_sid: The account_sid |
| 83 | + :param message_sid: The message_sid |
| 84 | + |
| 85 | + :returns: FeedbackPage |
| 86 | + :rtype: FeedbackPage |
| 87 | + """ |
| 88 | + super(FeedbackPage, self).__init__(version, response) |
| 89 | + |
| 90 | + # Path Solution |
| 91 | + self._solution = solution |
| 92 | + |
| 93 | + def get_instance(self, payload): |
| 94 | + """ |
| 95 | + Build an instance of FeedbackInstance |
| 96 | + |
| 97 | + :param dict payload: Payload response from the API |
| 98 | + |
| 99 | + :returns: FeedbackInstance |
| 100 | + :rtype: FeedbackInstance |
| 101 | + """ |
| 102 | + return FeedbackInstance( |
| 103 | + self._version, |
| 104 | + payload, |
| 105 | + account_sid=self._solution['account_sid'], |
| 106 | + message_sid=self._solution['message_sid'], |
| 107 | + ) |
| 108 | + |
| 109 | + def __repr__(self): |
| 110 | + """ |
| 111 | + Provide a friendly representation |
| 112 | + |
| 113 | + :returns: Machine friendly representation |
| 114 | + :rtype: str |
| 115 | + """ |
| 116 | + return '<Twilio.Api.V2010.FeedbackPage>' |
| 117 | + |
| 118 | + |
| 119 | +class FeedbackInstance(InstanceResource): |
| 120 | + |
| 121 | + def __init__(self, version, payload, account_sid, message_sid): |
| 122 | + """ |
| 123 | + Initialize the FeedbackInstance |
| 124 | + |
| 125 | + :returns: FeedbackInstance |
| 126 | + :rtype: FeedbackInstance |
| 127 | + """ |
| 128 | + super(FeedbackInstance, self).__init__(version) |
| 129 | + |
| 130 | + # Marshaled Properties |
| 131 | + self._properties = { |
| 132 | + 'account_sid': payload['account_sid'], |
| 133 | + 'message_sid': payload['message_sid'], |
| 134 | + 'outcome': payload['outcome'], |
| 135 | + 'date_created': deserialize.rfc2822_datetime(payload['date_created']), |
| 136 | + 'date_updated': deserialize.rfc2822_datetime(payload['date_updated']), |
| 137 | + 'uri': payload['uri'], |
| 138 | + } |
| 139 | + |
| 140 | + # Context |
| 141 | + self._context = None |
| 142 | + self._solution = { |
| 143 | + 'account_sid': account_sid, |
| 144 | + 'message_sid': message_sid, |
| 145 | + } |
| 146 | + |
| 147 | + @property |
| 148 | + def account_sid(self): |
| 149 | + """ |
| 150 | + :returns: The account_sid |
| 151 | + :rtype: unicode |
| 152 | + """ |
| 153 | + return self._properties['account_sid'] |
| 154 | + |
| 155 | + @property |
| 156 | + def message_sid(self): |
| 157 | + """ |
| 158 | + :returns: The message_sid |
| 159 | + :rtype: unicode |
| 160 | + """ |
| 161 | + return self._properties['message_sid'] |
| 162 | + |
| 163 | + @property |
| 164 | + def outcome(self): |
| 165 | + """ |
| 166 | + :returns: The outcome |
| 167 | + :rtype: feedback.outcome |
| 168 | + """ |
| 169 | + return self._properties['outcome'] |
| 170 | + |
| 171 | + @property |
| 172 | + def date_created(self): |
| 173 | + """ |
| 174 | + :returns: The date_created |
| 175 | + :rtype: datetime |
| 176 | + """ |
| 177 | + return self._properties['date_created'] |
| 178 | + |
| 179 | + @property |
| 180 | + def date_updated(self): |
| 181 | + """ |
| 182 | + :returns: The date_updated |
| 183 | + :rtype: datetime |
| 184 | + """ |
| 185 | + return self._properties['date_updated'] |
| 186 | + |
| 187 | + @property |
| 188 | + def uri(self): |
| 189 | + """ |
| 190 | + :returns: The uri |
| 191 | + :rtype: unicode |
| 192 | + """ |
| 193 | + return self._properties['uri'] |
| 194 | + |
| 195 | + def __repr__(self): |
| 196 | + """ |
| 197 | + Provide a friendly representation |
| 198 | + |
| 199 | + :returns: Machine friendly representation |
| 200 | + :rtype: str |
| 201 | + """ |
| 202 | + return '<Twilio.Api.V2010.FeedbackInstance>' |
0 commit comments