pullzone_add_custom_certificate.go raw

   1  package bunny
   2  
   3  import (
   4  	"context"
   5  	"fmt"
   6  )
   7  
   8  // PullZoneAddCustomCertificateOptions are the request parameters for the Add Custom Certificate API Endpoint.
   9  //
  10  // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_addcertificate
  11  type PullZoneAddCustomCertificateOptions struct {
  12  	Hostname       string `json:"Hostname"`
  13  	Certificate    []byte `json:"Certificate"`
  14  	CertificateKey []byte `json:"CertificateKey"`
  15  }
  16  
  17  // AddCustomCertificate represents the Add Custom Certificate API Endpoint.
  18  //
  19  // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_addcertificate
  20  func (s *PullZoneService) AddCustomCertificate(ctx context.Context, pullZoneID int64, opts *PullZoneAddCustomCertificateOptions) error {
  21  	path := fmt.Sprintf("/pullzone/%d/addCertificate", pullZoneID)
  22  	return resourcePost(ctx, s.client, path, opts)
  23  }
  24