public void CorrectRequestForCreate()
        {
            var factory = Substitute.For <IConnection>();
            var client  = new CertificatesClient(factory);

            var body = new Models.Requests.Certificate();

            client.Create(body);

            factory.Received().ExecuteRequest <Certificate>("certificates", null, body, "certificate", Method.POST);
        }
Example #2
0
 /// <summary>
 /// Create a new Let's Encrypt Certificate:
 /// When using Let's Encrypt to create a certificate, the dns_names attribute must be provided,
 /// and the type must be set to "lets_encrypt".
 ///
 /// Create a new custom Certificate:
 /// When uploading a user-generated certificate, the private_key, leaf_certificate, and optionally the certificate_chain
 /// attributes should be provided. The type must be set to "custom".
 /// </summary>
 public Task <Certificate> Create(Models.Requests.Certificate certificate)
 {
     return(_connection.ExecuteRequest <Certificate>("certificates", null, certificate, "certificate", Method.POST));
 }