コード例 #1
0
    def create(self, start_date, end_date, include_subaccounts=values.unset,
               status_callback=values.unset, status_callback_method=values.unset):
        """
        Create a new FeedbackSummaryInstance

        :param date start_date: Only include usage that has occurred on or after this date.
        :param date end_date: Only include usage that has occurred on or before this date.
        :param bool include_subaccounts: true to include feedback entries for the master account and all subaccounts.
        :param unicode status_callback: The URL that Twilio will request when the Feedback Summary is completed.
        :param unicode status_callback_method: The HTTP method Twilio will use to make requests to the StatusCallback URL.

        :returns: Newly created FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'StatusCallback': status_callback,
            'StatusCallbackMethod': status_callback_method,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return FeedbackSummaryInstance(self._version, payload, account_sid=self._solution['account_sid'], )
コード例 #2
0
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of YesterdayInstance records from the API.
        Request is executed immediately

        :param YesterdayInstance.Category category: The category
        :param date start_date: The start_date
        :param date end_date: The end_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of YesterdayInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.yesterday.YesterdayPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return YesterdayPage(self._version, response, self._solution)
コード例 #3
0
ファイル: binding.py プロジェクト: kanyapnp/twilio-python
    def page(self, start_date=values.unset, end_date=values.unset,
             identity=values.unset, tag=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param date start_date: Only list Bindings created on or after the given date.
        :param date end_date: Only list Bindings created on or before the given date.
        :param unicode identity: Only list Bindings that have any of the specified Identities.
        :param unicode tag: Only list Bindings that have all of the specified Tags.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingPage
        """
        params = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Identity': serialize.map(identity, lambda e: e),
            'Tag': serialize.map(tag, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return BindingPage(self._version, response, self._solution)
コード例 #4
0
ファイル: feedback_summary.py プロジェクト: sarahchou/HoliBot
    def create(self, start_date, end_date, include_subaccounts=values.unset,
               status_callback=values.unset, status_callback_method=values.unset):
        """
        Create a new FeedbackSummaryInstance

        :param date start_date: The start_date
        :param date end_date: The end_date
        :param bool include_subaccounts: The include_subaccounts
        :param unicode status_callback: The status_callback
        :param unicode status_callback_method: The status_callback_method

        :returns: Newly created FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'StatusCallback': status_callback,
            'StatusCallbackMethod': status_callback_method,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return FeedbackSummaryInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
        )
コード例 #5
0
ファイル: recording.py プロジェクト: sarahchou/HoliBot
    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of RecordingInstance records from the API.
        Request is executed immediately

        :param date date_created_before: The date_created
        :param date date_created: The date_created
        :param date date_created_after: The date_created
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordingInstance
        :rtype: twilio.rest.api.v2010.account.call.recording.RecordingPage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_date(date_created_before),
            'DateCreated': serialize.iso8601_date(date_created),
            'DateCreated>': serialize.iso8601_date(date_created_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return RecordingPage(self._version, response, self._solution)
コード例 #6
0
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of LastMonthInstance records from the API.
        Request is executed immediately

        :param LastMonthInstance.Category category: The category
        :param date start_date: The start_date
        :param date end_date: The end_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of LastMonthInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.last_month.LastMonthPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return LastMonthPage(self._version, response, self._solution)
コード例 #7
0
ファイル: binding.py プロジェクト: RohitPr/PythonProjects
    def page(self, start_date=values.unset, end_date=values.unset,
             identity=values.unset, tag=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param date start_date: Only include usage that has occurred on or after this date
        :param date end_date: Only include usage that occurred on or before this date
        :param list[unicode] identity: The `identity` value of the resources to read
        :param list[unicode] tag: Only list Bindings that have all of the specified Tags
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingPage
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Identity': serialize.map(identity, lambda e: e),
            'Tag': serialize.map(tag, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(method='GET', uri=self._uri, params=data, )

        return BindingPage(self._version, response, self._solution)
コード例 #8
0
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of AllTimeInstance records from the API.
        Request is executed immediately

        :param AllTimeInstance.Category category: Only include usage of this usage category.
        :param date start_date: Only include usage that has occurred on or after this date.
        :param date end_date: Only include usage that has occurred on or before this date.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of AllTimeInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.all_time.AllTimePage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return AllTimePage(self._version, response, self._solution)
コード例 #9
0
    def create(self, start_date, end_date, include_subaccounts=values.unset,
               status_callback=values.unset, status_callback_method=values.unset):
        """
        Create the FeedbackSummaryInstance

        :param date start_date: Only include feedback given on or after this date
        :param date end_date: Only include feedback given on or before this date
        :param bool include_subaccounts: `true` includes feedback from the specified account and its subaccounts
        :param unicode status_callback: The URL that we will request when the feedback summary is complete
        :param unicode status_callback_method: The HTTP method we use to make requests to the StatusCallback URL

        :returns: The created FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'StatusCallback': status_callback,
            'StatusCallbackMethod': status_callback_method,
        })

        payload = self._version.create(method='POST', uri=self._uri, data=data, )

        return FeedbackSummaryInstance(self._version, payload, account_sid=self._solution['account_sid'], )
コード例 #10
0
    def page(self, log_level=values.unset, start_date=values.unset,
             end_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of AlertInstance records from the API.
        Request is executed immediately

        :param unicode log_level: Only show alerts for this log-level.
        :param date start_date: Only show Alerts on or after this date.
        :param date end_date: Only show Alerts on or before this date.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertPage
        """
        params = values.of({
            'LogLevel': log_level,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return AlertPage(self._version, response, self._solution)
コード例 #11
0
    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of RecordingInstance records from the API.
        Request is executed immediately

        :param date date_created_before: The date_created
        :param date date_created: The date_created
        :param date date_created_after: The date_created
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordingInstance
        :rtype: twilio.rest.api.v2010.account.call.recording.RecordingPage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_date(date_created_before),
            'DateCreated': serialize.iso8601_date(date_created),
            'DateCreated>': serialize.iso8601_date(date_created_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return RecordingPage(self._version, response, self._solution)
コード例 #12
0
    def page(self, start_date=values.unset, end_date=values.unset, tag=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of UserBindingInstance records from the API.
        Request is executed immediately

        :param date start_date: The start_date
        :param date end_date: The end_date
        :param unicode tag: The tag
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of UserBindingInstance
        :rtype: twilio.rest.notify.v1.service.user.user_binding.UserBindingPage
        """
        params = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Tag': serialize.map(tag, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return UserBindingPage(self._version, response, self._solution)
コード例 #13
0
    def page(self, start_date=values.unset, end_date=values.unset,
             identity=values.unset, tag=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param date start_date: The start_date
        :param date end_date: The end_date
        :param unicode identity: The identity
        :param unicode tag: The tag
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingPage
        """
        params = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Identity': identity,
            'Tag': tag,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return BindingPage(self._version, response, self._solution)
コード例 #14
0
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, include_subaccounts=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RecordInstance records from the API.
        Request is executed immediately

        :param RecordInstance.Category category: The usage category of the UsageRecord resources to read
        :param date start_date: Only include usage that has occurred on or after this date
        :param date end_date: Only include usage that occurred on or before this date
        :param bool include_subaccounts: Whether to include usage from the master account and all its subaccounts
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.RecordPage
        """
        data = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(method='GET', uri=self._uri, params=data, )

        return RecordPage(self._version, response, self._solution)
コード例 #15
0
    def page(self, log_level=values.unset, start_date=values.unset,
             end_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of AlertInstance records from the API.
        Request is executed immediately

        :param unicode log_level: The log_level
        :param date start_date: The start_date
        :param date end_date: The end_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertPage
        """
        params = values.of({
            'LogLevel': log_level,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return AlertPage(self._version, response, self._solution)
コード例 #16
0
    def create(self, start_date, end_date, include_subaccounts=values.unset,
               status_callback=values.unset, status_callback_method=values.unset):
        """
        Create a new FeedbackSummaryInstance

        :param date start_date: The start_date
        :param date end_date: The end_date
        :param bool include_subaccounts: The include_subaccounts
        :param unicode status_callback: The status_callback
        :param unicode status_callback_method: The status_callback_method

        :returns: Newly created FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'StatusCallback': status_callback,
            'StatusCallbackMethod': status_callback_method,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return FeedbackSummaryInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
        )
コード例 #17
0
    def page(self,
             log=values.unset,
             message_date_before=values.unset,
             message_date=values.unset,
             message_date_after=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of NotificationInstance records from the API.
        Request is executed immediately

        :param unicode log: Filter by log level
        :param date message_date_before: Filter by date
        :param date message_date: Filter by date
        :param date message_date_after: Filter by date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of NotificationInstance
        :rtype: twilio.rest.api.v2010.account.notification.NotificationPage
        """
        params = values.of({
            'Log':
            log,
            'MessageDate<':
            serialize.iso8601_date(message_date_before),
            'MessageDate':
            serialize.iso8601_date(message_date),
            'MessageDate>':
            serialize.iso8601_date(message_date_after),
            'PageToken':
            page_token,
            'Page':
            page_number,
            'PageSize':
            page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return NotificationPage(self._version, response, self._solution)
コード例 #18
0
    def page(self,
             actor_sid=values.unset,
             event_type=values.unset,
             resource_sid=values.unset,
             source_ip_address=values.unset,
             start_date=values.unset,
             end_date=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param unicode actor_sid: The actor_sid
        :param unicode event_type: The event_type
        :param unicode resource_sid: The resource_sid
        :param unicode source_ip_address: The source_ip_address
        :param date start_date: The start_date
        :param date end_date: The end_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventPage
        """
        params = values.of({
            'ActorSid': actor_sid,
            'EventType': event_type,
            'ResourceSid': resource_sid,
            'SourceIpAddress': source_ip_address,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return EventPage(self._version, response, self._solution)
コード例 #19
0
 def test_create_request(self):
     self.holodeck.mock(Response(500, ''))
     
     with self.assertRaises(TwilioException):
         self.client.api.v2010.accounts(sid="ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .calls \
                              .feedback_summaries.create(start_date=date(2008, 1, 2), end_date=date(2008, 1, 2))
     
     values = {
         'StartDate': serialize.iso8601_date(date(2008, 1, 2)),
         'EndDate': serialize.iso8601_date(date(2008, 1, 2)),
     }
     
     self.holodeck.assert_has_request(Request(
         'post',
         'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json',
         data=values,
     ))
コード例 #20
0
    def test_create_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.api.v2010.accounts(sid="ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                 .calls \
                                 .feedback_summaries.create(start_date=date(2008, 1, 2), end_date=date(2008, 1, 2))

        values = {
            'StartDate': serialize.iso8601_date(date(2008, 1, 2)),
            'EndDate': serialize.iso8601_date(date(2008, 1, 2)),
        }

        self.holodeck.assert_has_request(Request(
            'post',
            'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/FeedbackSummary.json',
            data=values,
        ))
コード例 #21
0
    def page(self, actor_sid=values.unset, event_type=values.unset,
             resource_sid=values.unset, source_ip_address=values.unset,
             start_date=values.unset, end_date=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param unicode actor_sid: The actor_sid
        :param unicode event_type: The event_type
        :param unicode resource_sid: The resource_sid
        :param unicode source_ip_address: The source_ip_address
        :param date start_date: The start_date
        :param date end_date: The end_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventPage
        """
        params = values.of({
            'ActorSid': actor_sid,
            'EventType': event_type,
            'ResourceSid': resource_sid,
            'SourceIpAddress': source_ip_address,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return EventPage(self._version, response, self._solution)
コード例 #22
0
    def page(self,
             category=values.unset,
             start_date=values.unset,
             end_date=values.unset,
             include_subaccounts=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of ThisMonthInstance records from the API.
        Request is executed immediately

        :param ThisMonthInstance.Category category: Only include usage of this usage category.
        :param date start_date: Only include usage that has occurred on or after this date.
        :param date end_date: Only include usage that has occurred on or before this date.
        :param bool include_subaccounts: The include_subaccounts
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ThisMonthInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.this_month.ThisMonthPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return ThisMonthPage(self._version, response, self._solution)
コード例 #23
0
    def page(self,
             category=values.unset,
             start_date=values.unset,
             end_date=values.unset,
             include_subaccounts=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RecordInstance records from the API.
        Request is executed immediately

        :param RecordInstance.Category category: Only include usage of a given category
        :param date start_date: Filter by start date
        :param date end_date: Filter by end date
        :param bool include_subaccounts: Include usage from the master account and all subaccounts
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.RecordPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return RecordPage(self._version, response, self._solution)
コード例 #24
0
    def fetch(self, date=values.unset):
        """
        Fetch the DeactivationsInstance

        :param date date: The date to retrieve deactivated numbers for.

        :returns: The fetched DeactivationsInstance
        :rtype: twilio.rest.messaging.v1.deactivation.DeactivationsInstance
        """
        data = values.of({'Date': serialize.iso8601_date(date), })

        payload = self._version.fetch(method='GET', uri=self._uri, params=data, )

        return DeactivationsInstance(self._version, payload, )
コード例 #25
0
    def create(self,
               start_date,
               end_date,
               include_subaccounts=values.unset,
               status_callback=values.unset,
               status_callback_method=values.unset):
        """
        Create a new FeedbackSummaryInstance

        :param date start_date: Only include usage that has occurred on or after this date.
        :param date end_date: Only include usage that has occurred on or before this date.
        :param bool include_subaccounts: true to include feedback entries for the master account and all subaccounts.
        :param unicode status_callback: The URL that Twilio will request when the Feedback Summary is completed.
        :param unicode status_callback_method: The HTTP method Twilio will use to make requests to the StatusCallback URL.

        :returns: Newly created FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        data = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'StatusCallback': status_callback,
            'StatusCallbackMethod': status_callback_method,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return FeedbackSummaryInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
        )
コード例 #26
0
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, include_subaccounts=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RecordInstance records from the API.
        Request is executed immediately

        :param RecordInstance.Category category: Only include usage of a given category
        :param date start_date: Filter by start date
        :param date end_date: Filter by end date
        :param bool include_subaccounts: The include_subaccounts
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.RecordPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return RecordPage(self._version, response, self._solution)
コード例 #27
0
ファイル: today.py プロジェクト: twilio/twilio-python
    def page(self, category=values.unset, start_date=values.unset,
             end_date=values.unset, include_subaccounts=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of TodayInstance records from the API.
        Request is executed immediately

        :param TodayInstance.Category category: The usage category of the UsageRecord resources to read
        :param date start_date: Only include usage that has occurred on or after this date
        :param date end_date: Only include usage that occurred on or before this date
        :param bool include_subaccounts: Whether to include usage from the master account and all its subaccounts
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of TodayInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.today.TodayPage
        """
        params = values.of({
            'Category': category,
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'IncludeSubaccounts': include_subaccounts,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return TodayPage(self._version, response, self._solution)
コード例 #28
0
ファイル: notification.py プロジェクト: twilio/twilio-python
    def page(self, log=values.unset, message_date_before=values.unset,
             message_date=values.unset, message_date_after=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of NotificationInstance records from the API.
        Request is executed immediately

        :param unicode log: Filter by log level
        :param date message_date_before: Filter by date
        :param date message_date: Filter by date
        :param date message_date_after: Filter by date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationPage
        """
        params = values.of({
            'Log': log,
            'MessageDate<': serialize.iso8601_date(message_date_before),
            'MessageDate': serialize.iso8601_date(message_date),
            'MessageDate>': serialize.iso8601_date(message_date_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return NotificationPage(self._version, response, self._solution)
コード例 #29
0
    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, date_updated_before=values.unset,
             date_updated=values.unset, date_updated_after=values.unset,
             friendly_name=values.unset, status=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of ConferenceInstance records from the API.
        Request is executed immediately

        :param date date_created_before: Filter by date created
        :param date date_created: Filter by date created
        :param date date_created_after: Filter by date created
        :param date date_updated_before: Filter by date updated
        :param date date_updated: Filter by date updated
        :param date date_updated_after: Filter by date updated
        :param unicode friendly_name: Filter by friendly name
        :param ConferenceInstance.Status status: The status of the conference
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ConferenceInstance
        :rtype: twilio.rest.api.v2010.account.conference.ConferencePage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_date(date_created_before),
            'DateCreated': serialize.iso8601_date(date_created),
            'DateCreated>': serialize.iso8601_date(date_created_after),
            'DateUpdated<': serialize.iso8601_date(date_updated_before),
            'DateUpdated': serialize.iso8601_date(date_updated),
            'DateUpdated>': serialize.iso8601_date(date_updated_after),
            'FriendlyName': friendly_name,
            'Status': status,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return ConferencePage(self._version, response, self._solution)
コード例 #30
0
    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, date_updated_before=values.unset,
             date_updated=values.unset, date_updated_after=values.unset,
             friendly_name=values.unset, status=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of ConferenceInstance records from the API.
        Request is executed immediately

        :param date date_created_before: Filter by date created
        :param date date_created: Filter by date created
        :param date date_created_after: Filter by date created
        :param date date_updated_before: Filter by date updated
        :param date date_updated: Filter by date updated
        :param date date_updated_after: Filter by date updated
        :param unicode friendly_name: Filter by friendly name
        :param ConferenceInstance.Status status: The status of the conference
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ConferenceInstance
        :rtype: twilio.rest.api.v2010.account.conference.ConferencePage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_date(date_created_before),
            'DateCreated': serialize.iso8601_date(date_created),
            'DateCreated>': serialize.iso8601_date(date_created_after),
            'DateUpdated<': serialize.iso8601_date(date_updated_before),
            'DateUpdated': serialize.iso8601_date(date_updated),
            'DateUpdated>': serialize.iso8601_date(date_updated_after),
            'FriendlyName': friendly_name,
            'Status': status,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return ConferencePage(self._version, response, self._solution)
コード例 #31
0
 def test_unset(self):
     value = values.unset
     actual = serialize.iso8601_date(value)
     self.assertEqual(values.unset, actual)
コード例 #32
0
 def test_str(self):
     actual = serialize.iso8601_date('2015-01-02')
     self.assertEqual('2015-01-02', actual)
コード例 #33
0
 def test_date(self):
     value = datetime.date(2015, 1, 2)
     actual = serialize.iso8601_date(value)
     self.assertEqual('2015-01-02', actual)
コード例 #34
0
 def test_unset(self):
     value = values.unset
     actual = serialize.iso8601_date(value)
     self.assertEqual(values.unset, actual)
コード例 #35
0
 def test_str(self):
     actual = serialize.iso8601_date('2015-01-02')
     self.assertEqual('2015-01-02', actual)
コード例 #36
0
 def test_date(self):
     value = datetime.date(2015, 1, 2)
     actual = serialize.iso8601_date(value)
     self.assertEqual('2015-01-02', actual)