github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/elb/v3/logtanks/results.go (about)

     1  package logtanks
     2  
     3  import (
     4  	"github.com/chnsz/golangsdk"
     5  )
     6  
     7  type LogTank struct {
     8  	// The unique ID for the LogTank.
     9  	ID string `json:"id"`
    10  
    11  	// The Loadbalancer on which the log associated with.
    12  	LoadbalancerID string `json:"loadbalancer_id"`
    13  
    14  	// The log group on which the log associated with.
    15  	LogGroupId string `json:"log_group_id"`
    16  
    17  	// The topic on which the log subscribe.
    18  	LogTopicId string `json:"log_topic_id"`
    19  }
    20  
    21  type commonResult struct {
    22  	golangsdk.Result
    23  }
    24  
    25  // Extract is a function that accepts a result and extracts a logtank.
    26  func (r commonResult) Extract() (*LogTank, error) {
    27  	var s struct {
    28  		LogTank *LogTank `json:"logtank"`
    29  	}
    30  	err := r.ExtractInto(&s)
    31  	return s.LogTank, err
    32  }
    33  
    34  // CreateResult represents the result of a create operation. Call its Extract
    35  // method to interpret it as a LogTank.
    36  type CreateResult struct {
    37  	commonResult
    38  }
    39  
    40  // GetResult represents the result of a get operation. Call its Extract
    41  // method to interpret it as a LogTank.
    42  type GetResult struct {
    43  	commonResult
    44  }
    45  
    46  // UpdateResult represents the result of an update operation. Call its Extract
    47  // method to interpret it as a LogTank.
    48  type UpdateResult struct {
    49  	commonResult
    50  }
    51  
    52  // DeleteResult represents the result of a delete operation. Call its
    53  // ExtractErr method to determine if the request succeeded or failed.
    54  type DeleteResult struct {
    55  	golangsdk.ErrResult
    56  }