/// <summary>
        /// Add a Network resource to the Network Access Profile resource.
        /// </summary>
        /// <param name="pathNetworkAccessProfileSid"> The unique string that identifies the Network Access Profile resource
        ///                                   </param>
        /// <param name="network"> The SID that identifies the Network resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of NetworkAccessProfileNetwork </returns>
        public static async System.Threading.Tasks.Task <NetworkAccessProfileNetworkResource> CreateAsync(string pathNetworkAccessProfileSid,
                                                                                                          string network,
                                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, network);

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// Add a Network resource to the Network Access Profile resource.
        /// </summary>
        /// <param name="pathNetworkAccessProfileSid"> The unique string that identifies the Network Access Profile resource
        ///                                   </param>
        /// <param name="network"> The SID that identifies the Network resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of NetworkAccessProfileNetwork </returns>
        public static NetworkAccessProfileNetworkResource Create(string pathNetworkAccessProfileSid,
                                                                 string network,
                                                                 ITwilioRestClient client = null)
        {
            var options = new CreateNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, network);

            return(Create(options, client));
        }
        /// <summary>
        /// Add a Network resource to the Network Access Profile resource.
        /// </summary>
        /// <param name="options"> Create NetworkAccessProfileNetwork parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of NetworkAccessProfileNetwork </returns>
        public static NetworkAccessProfileNetworkResource Create(CreateNetworkAccessProfileNetworkOptions options,
                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #4
0
 private static Request BuildCreateRequest(CreateNetworkAccessProfileNetworkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Supersim,
                "/v1/NetworkAccessProfiles/" + options.PathNetworkAccessProfileSid + "/Networks",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Add a Network resource to the Network Access Profile resource.
        /// </summary>
        /// <param name="options"> Create NetworkAccessProfileNetwork parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of NetworkAccessProfileNetwork </returns>
        public static async System.Threading.Tasks.Task <NetworkAccessProfileNetworkResource> CreateAsync(CreateNetworkAccessProfileNetworkOptions options,
                                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }