mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.8 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the CartOpen type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CartOpen{}
|
|
|
|
// CartOpen struct for CartOpen
|
|
type CartOpen struct {
|
|
// Currency is the ISO 4217 code the cart is priced in, lower-cased. Empty means usd.
|
|
Currency *string `json:"currency,omitempty"`
|
|
// Email is the shopper's address, for a cart that belongs to someone who has not signed in. It is what a guest checkout and an abandoned-cart follow-up key on. Empty is fine.
|
|
Email *string `json:"email,omitempty"`
|
|
// Store is the storefront this cart is being filled on. Empty uses the org's default store, which is what a single-storefront merchant always wants.
|
|
Store *string `json:"store,omitempty"`
|
|
// User is the id of the signed-in shopper this cart belongs to, when there is one. Empty means a guest cart identified only by its own id.
|
|
User *string `json:"user,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CartOpen CartOpen
|
|
|
|
// NewCartOpen instantiates a new CartOpen object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewCartOpen() *CartOpen {
|
|
this := CartOpen{}
|
|
return &this
|
|
}
|
|
|
|
// NewCartOpenWithDefaults instantiates a new CartOpen object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewCartOpenWithDefaults() *CartOpen {
|
|
this := CartOpen{}
|
|
return &this
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *CartOpen) GetCurrency() string {
|
|
if o == nil || IsNil(o.Currency) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Currency
|
|
}
|
|
|
|
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CartOpen) GetCurrencyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Currency) {
|
|
return nil, false
|
|
}
|
|
return o.Currency, true
|
|
}
|
|
|
|
// HasCurrency returns a boolean if a field has been set.
|
|
func (o *CartOpen) HasCurrency() bool {
|
|
if o != nil && !IsNil(o.Currency) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
|
func (o *CartOpen) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetEmail returns the Email field value if set, zero value otherwise.
|
|
func (o *CartOpen) GetEmail() string {
|
|
if o == nil || IsNil(o.Email) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Email
|
|
}
|
|
|
|
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CartOpen) GetEmailOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Email) {
|
|
return nil, false
|
|
}
|
|
return o.Email, true
|
|
}
|
|
|
|
// HasEmail returns a boolean if a field has been set.
|
|
func (o *CartOpen) HasEmail() bool {
|
|
if o != nil && !IsNil(o.Email) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEmail gets a reference to the given string and assigns it to the Email field.
|
|
func (o *CartOpen) SetEmail(v string) {
|
|
o.Email = &v
|
|
}
|
|
|
|
// GetStore returns the Store field value if set, zero value otherwise.
|
|
func (o *CartOpen) GetStore() string {
|
|
if o == nil || IsNil(o.Store) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Store
|
|
}
|
|
|
|
// GetStoreOk returns a tuple with the Store field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CartOpen) GetStoreOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Store) {
|
|
return nil, false
|
|
}
|
|
return o.Store, true
|
|
}
|
|
|
|
// HasStore returns a boolean if a field has been set.
|
|
func (o *CartOpen) HasStore() bool {
|
|
if o != nil && !IsNil(o.Store) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStore gets a reference to the given string and assigns it to the Store field.
|
|
func (o *CartOpen) SetStore(v string) {
|
|
o.Store = &v
|
|
}
|
|
|
|
// GetUser returns the User field value if set, zero value otherwise.
|
|
func (o *CartOpen) GetUser() string {
|
|
if o == nil || IsNil(o.User) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.User
|
|
}
|
|
|
|
// GetUserOk returns a tuple with the User field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CartOpen) GetUserOk() (*string, bool) {
|
|
if o == nil || IsNil(o.User) {
|
|
return nil, false
|
|
}
|
|
return o.User, true
|
|
}
|
|
|
|
// HasUser returns a boolean if a field has been set.
|
|
func (o *CartOpen) HasUser() bool {
|
|
if o != nil && !IsNil(o.User) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUser gets a reference to the given string and assigns it to the User field.
|
|
func (o *CartOpen) SetUser(v string) {
|
|
o.User = &v
|
|
}
|
|
|
|
func (o CartOpen) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CartOpen) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.Email) {
|
|
toSerialize["email"] = o.Email
|
|
}
|
|
if !IsNil(o.Store) {
|
|
toSerialize["store"] = o.Store
|
|
}
|
|
if !IsNil(o.User) {
|
|
toSerialize["user"] = o.User
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CartOpen) UnmarshalJSON(data []byte) (err error) {
|
|
varCartOpen := _CartOpen{}
|
|
|
|
err = json.Unmarshal(data, &varCartOpen)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CartOpen(varCartOpen)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "email")
|
|
delete(additionalProperties, "store")
|
|
delete(additionalProperties, "user")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCartOpen struct {
|
|
value *CartOpen
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCartOpen) Get() *CartOpen {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCartOpen) Set(val *CartOpen) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCartOpen) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCartOpen) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCartOpen(val *CartOpen) *NullableCartOpen {
|
|
return &NullableCartOpen{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCartOpen) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCartOpen) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|