put_kv_request_model.go raw

   1  // This file is auto-generated, don't edit it. Thanks.
   2  package client
   3  
   4  import (
   5  	"github.com/alibabacloud-go/tea/dara"
   6  )
   7  
   8  type iPutKvRequest interface {
   9  	dara.Model
  10  	String() string
  11  	GoString() string
  12  	SetBase64(v bool) *PutKvRequest
  13  	GetBase64() *bool
  14  	SetExpiration(v int64) *PutKvRequest
  15  	GetExpiration() *int64
  16  	SetExpirationTtl(v int64) *PutKvRequest
  17  	GetExpirationTtl() *int64
  18  	SetKey(v string) *PutKvRequest
  19  	GetKey() *string
  20  	SetNamespace(v string) *PutKvRequest
  21  	GetNamespace() *string
  22  	SetValue(v string) *PutKvRequest
  23  	GetValue() *string
  24  }
  25  
  26  type PutKvRequest struct {
  27  	// Specifies whether the content of the key is Base64-encoded. Set this parameter to true if you want to store the key content in binary format. When this parameter is set to true, the Value parameter must be Base64-encoded.
  28  	//
  29  	// example:
  30  	//
  31  	// true
  32  	Base64 *bool `json:"Base64,omitempty" xml:"Base64,omitempty"`
  33  	// The time when the key-value pair expires, which cannot be earlier than the current time. The value is a timestamp in seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
  34  	//
  35  	// example:
  36  	//
  37  	// 1690081381
  38  	Expiration *int64 `json:"Expiration,omitempty" xml:"Expiration,omitempty"`
  39  	// The relative expiration time. Unit: seconds. If you specify both Expiration and ExpirationTtl, only ExpirationTtl takes effect.
  40  	//
  41  	// example:
  42  	//
  43  	// 3600
  44  	ExpirationTtl *int64 `json:"ExpirationTtl,omitempty" xml:"ExpirationTtl,omitempty"`
  45  	// The key name. The name can be up to 512 characters in length and cannot contain spaces or backslashes (\\\\).
  46  	//
  47  	// This parameter is required.
  48  	//
  49  	// example:
  50  	//
  51  	// test_key
  52  	Key *string `json:"Key,omitempty" xml:"Key,omitempty"`
  53  	// The name of the namespace that you specify when you call the [CreateKvNamespace](https://help.aliyun.com/document_detail/2850317.html) operation.
  54  	//
  55  	// This parameter is required.
  56  	//
  57  	// example:
  58  	//
  59  	// test_namespace
  60  	Namespace *string `json:"Namespace,omitempty" xml:"Namespace,omitempty"`
  61  	// The content of the key, which can be up to 2 MB (2 × 1000 × 1000). If the content is larger than 2 MB, call [PutKvWithHighCapacity](https://help.aliyun.com/document_detail/2850486.html).
  62  	//
  63  	// This parameter is required.
  64  	//
  65  	// example:
  66  	//
  67  	// test_value
  68  	Value *string `json:"Value,omitempty" xml:"Value,omitempty"`
  69  }
  70  
  71  func (s PutKvRequest) String() string {
  72  	return dara.Prettify(s)
  73  }
  74  
  75  func (s PutKvRequest) GoString() string {
  76  	return s.String()
  77  }
  78  
  79  func (s *PutKvRequest) GetBase64() *bool {
  80  	return s.Base64
  81  }
  82  
  83  func (s *PutKvRequest) GetExpiration() *int64 {
  84  	return s.Expiration
  85  }
  86  
  87  func (s *PutKvRequest) GetExpirationTtl() *int64 {
  88  	return s.ExpirationTtl
  89  }
  90  
  91  func (s *PutKvRequest) GetKey() *string {
  92  	return s.Key
  93  }
  94  
  95  func (s *PutKvRequest) GetNamespace() *string {
  96  	return s.Namespace
  97  }
  98  
  99  func (s *PutKvRequest) GetValue() *string {
 100  	return s.Value
 101  }
 102  
 103  func (s *PutKvRequest) SetBase64(v bool) *PutKvRequest {
 104  	s.Base64 = &v
 105  	return s
 106  }
 107  
 108  func (s *PutKvRequest) SetExpiration(v int64) *PutKvRequest {
 109  	s.Expiration = &v
 110  	return s
 111  }
 112  
 113  func (s *PutKvRequest) SetExpirationTtl(v int64) *PutKvRequest {
 114  	s.ExpirationTtl = &v
 115  	return s
 116  }
 117  
 118  func (s *PutKvRequest) SetKey(v string) *PutKvRequest {
 119  	s.Key = &v
 120  	return s
 121  }
 122  
 123  func (s *PutKvRequest) SetNamespace(v string) *PutKvRequest {
 124  	s.Namespace = &v
 125  	return s
 126  }
 127  
 128  func (s *PutKvRequest) SetValue(v string) *PutKvRequest {
 129  	s.Value = &v
 130  	return s
 131  }
 132  
 133  func (s *PutKvRequest) Validate() error {
 134  	return dara.Validate(s)
 135  }
 136