コード例 #1
0
        /// <summary>
        /// Retrieve a list of all Customer-Profiles for an account.
        /// </summary>
        /// <param name="options"> Read CustomerProfiles parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CustomerProfiles </returns>
        public static ResourceSet <CustomerProfilesResource> Read(ReadCustomerProfilesOptions options,
                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <CustomerProfilesResource> .FromJson("results", response.Content);

            return(new ResourceSet <CustomerProfilesResource>(page, options, client));
        }
コード例 #2
0
 private static Request BuildReadRequest(ReadCustomerProfilesOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Trusthub,
                "/v1/CustomerProfiles",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
コード例 #3
0
        /// <summary>
        /// Retrieve a list of all Customer-Profiles for an account.
        /// </summary>
        /// <param name="status"> The verification status of the Customer-Profile resource </param>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="policySid"> The unique string of a policy. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CustomerProfiles </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CustomerProfilesResource> > ReadAsync(CustomerProfilesResource.StatusEnum status = null,
                                                                                                            string friendlyName      = null,
                                                                                                            string policySid         = null,
                                                                                                            int?pageSize             = null,
                                                                                                            long?limit               = null,
                                                                                                            ITwilioRestClient client = null)
        {
            var options = new ReadCustomerProfilesOptions()
            {
                Status = status, FriendlyName = friendlyName, PolicySid = policySid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Retrieve a list of all Customer-Profiles for an account.
        /// </summary>
        /// <param name="status"> The verification status of the Customer-Profile resource </param>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="policySid"> The unique string of a policy. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CustomerProfiles </returns>
        public static ResourceSet <CustomerProfilesResource> Read(CustomerProfilesResource.StatusEnum status = null,
                                                                  string friendlyName      = null,
                                                                  string policySid         = null,
                                                                  int?pageSize             = null,
                                                                  long?limit               = null,
                                                                  ITwilioRestClient client = null)
        {
            var options = new ReadCustomerProfilesOptions()
            {
                Status = status, FriendlyName = friendlyName, PolicySid = policySid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Retrieve a list of all Customer-Profiles for an account.
        /// </summary>
        /// <param name="options"> Read CustomerProfiles parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CustomerProfiles </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CustomerProfilesResource> > ReadAsync(ReadCustomerProfilesOptions options,
                                                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <CustomerProfilesResource> .FromJson("results", response.Content);

            return(new ResourceSet <CustomerProfilesResource>(page, options, client));
        }