/// <summary>
        /// Retrieve a list of all Certificate credentials belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read Certificate parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Certificate </returns>
        public static ResourceSet <CertificateResource> Read(ReadCertificateOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <CertificateResource> .FromJson("certificates", response.Content);

            return(new ResourceSet <CertificateResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of all Certificate credentials belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="deviceSid"> Find all Certificates authenticating specified Device. </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 Certificate </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CertificateResource> > ReadAsync(string pathFleetSid, string deviceSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadCertificateOptions(pathFleetSid)
            {
                DeviceSid = deviceSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadCertificateOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Certificates",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of all Certificate credentials belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="deviceSid"> Find all Certificates authenticating specified Device. </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 Certificate </returns>
        public static ResourceSet <CertificateResource> Read(string pathFleetSid, string deviceSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadCertificateOptions(pathFleetSid)
            {
                DeviceSid = deviceSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Certificate credentials belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read Certificate parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Certificate </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CertificateResource> > ReadAsync(ReadCertificateOptions options,
                                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <CertificateResource> .FromJson("certificates", response.Content);

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