DNSimple.DNSimpleRestClient.TransferDomain C# (CSharp) Méthode

TransferDomain() public méthode

Transfer a domain name from another domain registrar into DNSimple. Makes a POST request the Domain Transfer resource (domain_transfers).
Your account must already be active for this command to complete successfully. You will be automatically charged the 1 year transfer fee upon successful transfer of the domain, which may take anywhere from a few minutes up to 7 days. Only domains that do not require extended attributes may be transferred through the API at this time. For example, domains ending in .com and .net may be transferred through the API, however domains ending in .us and .ca may not.
public TransferDomain ( string name, int registrant_id, string authinfo = null ) : dynamic
name string The domain name to transfer
registrant_id int ID for an existing contact
authinfo string
Résultat dynamic
        public dynamic TransferDomain(string name, int registrant_id, string authinfo = null)
        {
            Require.Argument("name", name);
            Require.Argument("registrant_id", registrant_id);

            var request = new RestRequest(Method.POST)
            {
                RequestFormat = DataFormat.Json,
                Resource = "domain_transfers"
            };

            dynamic payload = new ExpandoObject();
            payload.domain = new
                             	{
                             		name = name,
                             		registrant_id = registrant_id
                             	};
            if (!string.IsNullOrWhiteSpace(authinfo))
            {
                payload.transfer_order = new { authinfo = authinfo };
            }

            request.AddBody(payload);

            return Execute<dynamic>(request);
        }