github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/dns/v2/ptrrecords/results.go (about)

     1  package ptrrecords
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type commonResult struct {
     8  	golangsdk.Result
     9  }
    10  
    11  // Extract interprets a GetResult, CreateResult as a Ptr.
    12  // An error is returned if the original call or the extraction failed.
    13  func (r commonResult) Extract() (*Ptr, error) {
    14  	var s *Ptr
    15  	err := r.ExtractInto(&s)
    16  	return s, err
    17  }
    18  
    19  // CreateResult is the result of a Create request. Call its Extract method
    20  // to interpret the result as a Ptr.
    21  type CreateResult struct {
    22  	commonResult
    23  }
    24  
    25  // GetResult is the result of a Get request. Call its Extract method
    26  // to interpret the result as a Ptr.
    27  type GetResult struct {
    28  	commonResult
    29  }
    30  
    31  // DeleteResult is the result of a Delete request. Call its ExtractErr method
    32  // to determine if the request succeeded or failed.
    33  type DeleteResult struct {
    34  	golangsdk.ErrResult
    35  }
    36  
    37  // Ptr represents a ptr record.
    38  type Ptr struct {
    39  	// ID uniquely identifies this ptr amongst all other ptr records.
    40  	ID string `json:"id"`
    41  
    42  	// Name for this ptr.
    43  	PtrName string `json:"ptrdname"`
    44  
    45  	// Description for this ptr.
    46  	Description string `json:"description"`
    47  
    48  	// TTL is the Time to Live for the ptr.
    49  	TTL int `json:"ttl"`
    50  
    51  	// Address of the floating ip.
    52  	Address string `json:"address"`
    53  
    54  	// Status of the PTR.
    55  	Status string `json:"status"`
    56  
    57  	// Enterprise project id
    58  	EnterpriseProjectID string `json:"enterprise_project_id"`
    59  }