mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
573 lines
16 KiB
Go
573 lines
16 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 TranslateMemoryEntry type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TranslateMemoryEntry{}
|
|
|
|
// TranslateMemoryEntry struct for TranslateMemoryEntry
|
|
type TranslateMemoryEntry struct {
|
|
// Actor is the validated user id that last wrote this entry by hand. Empty on an entry an engine produced, and on one written before attribution existed.
|
|
Actor *string `json:"actor,omitempty"`
|
|
// Format is the markup the source carried: text, html or markdown. Part of the identity.
|
|
Format *string `json:"format,omitempty"`
|
|
// Glossary is the glossary VERSION the entry was translated under — the digest version() derives from the terms, so changing a term changes the key and the stale rendering can never be served.
|
|
GlossaryVersion *string `json:"glossary_version,omitempty"`
|
|
// Lang is the source language the translate call declared, empty when the engine detected it. Part of the identity; an entry with none also serves a call that declares one.
|
|
Lang *string `json:"lang,omitempty"`
|
|
// Model is the quality-tier model the translate call named, empty for the default. Part of the identity: one model's rendering never answers for another's.
|
|
Model *string `json:"model,omitempty"`
|
|
// RequestID is the X-Request-Id of the translate call whose engine produced the entry. Empty on an entry a human wrote, and on one older than the field.
|
|
RequestId *string `json:"request_id,omitempty"`
|
|
// Source is the ORIGINAL string this entry translates. Part of the identity.
|
|
Source *string `json:"source,omitempty"`
|
|
// State is the entry's position on the review ladder: machine, suggested, approved or published.
|
|
State *string `json:"state,omitempty"`
|
|
// Target is the target language tag (BCP-47, e.g. \"es\" or \"pt-BR\"). Part of the identity.
|
|
Target *string `json:"target,omitempty"`
|
|
// Text is the stored translation. A memory hit returns it verbatim, which is the idempotence contract.
|
|
Text *string `json:"text,omitempty"`
|
|
// Tier is the engine tier the entry belongs to, quality or bulk. Part of the identity: the two tiers keep separate renderings of the same source.
|
|
Tier *string `json:"tier,omitempty"`
|
|
// UpdatedAt is the unix second the entry last changed.
|
|
UpdatedAt *int64 `json:"updated_at,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TranslateMemoryEntry TranslateMemoryEntry
|
|
|
|
// NewTranslateMemoryEntry instantiates a new TranslateMemoryEntry 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 NewTranslateMemoryEntry() *TranslateMemoryEntry {
|
|
this := TranslateMemoryEntry{}
|
|
return &this
|
|
}
|
|
|
|
// NewTranslateMemoryEntryWithDefaults instantiates a new TranslateMemoryEntry 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 NewTranslateMemoryEntryWithDefaults() *TranslateMemoryEntry {
|
|
this := TranslateMemoryEntry{}
|
|
return &this
|
|
}
|
|
|
|
// GetActor returns the Actor field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetActor() string {
|
|
if o == nil || IsNil(o.Actor) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Actor
|
|
}
|
|
|
|
// GetActorOk returns a tuple with the Actor field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetActorOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Actor) {
|
|
return nil, false
|
|
}
|
|
return o.Actor, true
|
|
}
|
|
|
|
// HasActor returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasActor() bool {
|
|
if o != nil && !IsNil(o.Actor) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetActor gets a reference to the given string and assigns it to the Actor field.
|
|
func (o *TranslateMemoryEntry) SetActor(v string) {
|
|
o.Actor = &v
|
|
}
|
|
|
|
// GetFormat returns the Format field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetFormat() string {
|
|
if o == nil || IsNil(o.Format) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Format
|
|
}
|
|
|
|
// GetFormatOk returns a tuple with the Format field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetFormatOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Format) {
|
|
return nil, false
|
|
}
|
|
return o.Format, true
|
|
}
|
|
|
|
// HasFormat returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasFormat() bool {
|
|
if o != nil && !IsNil(o.Format) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFormat gets a reference to the given string and assigns it to the Format field.
|
|
func (o *TranslateMemoryEntry) SetFormat(v string) {
|
|
o.Format = &v
|
|
}
|
|
|
|
// GetGlossaryVersion returns the GlossaryVersion field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetGlossaryVersion() string {
|
|
if o == nil || IsNil(o.GlossaryVersion) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.GlossaryVersion
|
|
}
|
|
|
|
// GetGlossaryVersionOk returns a tuple with the GlossaryVersion field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetGlossaryVersionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.GlossaryVersion) {
|
|
return nil, false
|
|
}
|
|
return o.GlossaryVersion, true
|
|
}
|
|
|
|
// HasGlossaryVersion returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasGlossaryVersion() bool {
|
|
if o != nil && !IsNil(o.GlossaryVersion) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetGlossaryVersion gets a reference to the given string and assigns it to the GlossaryVersion field.
|
|
func (o *TranslateMemoryEntry) SetGlossaryVersion(v string) {
|
|
o.GlossaryVersion = &v
|
|
}
|
|
|
|
// GetLang returns the Lang field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetLang() string {
|
|
if o == nil || IsNil(o.Lang) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Lang
|
|
}
|
|
|
|
// GetLangOk returns a tuple with the Lang field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetLangOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Lang) {
|
|
return nil, false
|
|
}
|
|
return o.Lang, true
|
|
}
|
|
|
|
// HasLang returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasLang() bool {
|
|
if o != nil && !IsNil(o.Lang) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLang gets a reference to the given string and assigns it to the Lang field.
|
|
func (o *TranslateMemoryEntry) SetLang(v string) {
|
|
o.Lang = &v
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetModel() string {
|
|
if o == nil || IsNil(o.Model) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Model
|
|
}
|
|
|
|
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Model) {
|
|
return nil, false
|
|
}
|
|
return o.Model, true
|
|
}
|
|
|
|
// HasModel returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasModel() bool {
|
|
if o != nil && !IsNil(o.Model) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModel gets a reference to the given string and assigns it to the Model field.
|
|
func (o *TranslateMemoryEntry) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetRequestId returns the RequestId field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetRequestId() string {
|
|
if o == nil || IsNil(o.RequestId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.RequestId
|
|
}
|
|
|
|
// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetRequestIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.RequestId) {
|
|
return nil, false
|
|
}
|
|
return o.RequestId, true
|
|
}
|
|
|
|
// HasRequestId returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasRequestId() bool {
|
|
if o != nil && !IsNil(o.RequestId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRequestId gets a reference to the given string and assigns it to the RequestId field.
|
|
func (o *TranslateMemoryEntry) SetRequestId(v string) {
|
|
o.RequestId = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *TranslateMemoryEntry) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetState() string {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetStateOk() (*string, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given string and assigns it to the State field.
|
|
func (o *TranslateMemoryEntry) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetTarget returns the Target field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetTarget() string {
|
|
if o == nil || IsNil(o.Target) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Target
|
|
}
|
|
|
|
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetTargetOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Target) {
|
|
return nil, false
|
|
}
|
|
return o.Target, true
|
|
}
|
|
|
|
// HasTarget returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasTarget() bool {
|
|
if o != nil && !IsNil(o.Target) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTarget gets a reference to the given string and assigns it to the Target field.
|
|
func (o *TranslateMemoryEntry) SetTarget(v string) {
|
|
o.Target = &v
|
|
}
|
|
|
|
// GetText returns the Text field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetText() string {
|
|
if o == nil || IsNil(o.Text) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Text
|
|
}
|
|
|
|
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetTextOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Text) {
|
|
return nil, false
|
|
}
|
|
return o.Text, true
|
|
}
|
|
|
|
// HasText returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasText() bool {
|
|
if o != nil && !IsNil(o.Text) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetText gets a reference to the given string and assigns it to the Text field.
|
|
func (o *TranslateMemoryEntry) SetText(v string) {
|
|
o.Text = &v
|
|
}
|
|
|
|
// GetTier returns the Tier field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetTier() string {
|
|
if o == nil || IsNil(o.Tier) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Tier
|
|
}
|
|
|
|
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetTierOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Tier) {
|
|
return nil, false
|
|
}
|
|
return o.Tier, true
|
|
}
|
|
|
|
// HasTier returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasTier() bool {
|
|
if o != nil && !IsNil(o.Tier) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTier gets a reference to the given string and assigns it to the Tier field.
|
|
func (o *TranslateMemoryEntry) SetTier(v string) {
|
|
o.Tier = &v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *TranslateMemoryEntry) GetUpdatedAt() int64 {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.UpdatedAt
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TranslateMemoryEntry) GetUpdatedAtOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.UpdatedAt, true
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *TranslateMemoryEntry) HasUpdatedAt() bool {
|
|
if o != nil && !IsNil(o.UpdatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
|
|
func (o *TranslateMemoryEntry) SetUpdatedAt(v int64) {
|
|
o.UpdatedAt = &v
|
|
}
|
|
|
|
func (o TranslateMemoryEntry) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TranslateMemoryEntry) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Actor) {
|
|
toSerialize["actor"] = o.Actor
|
|
}
|
|
if !IsNil(o.Format) {
|
|
toSerialize["format"] = o.Format
|
|
}
|
|
if !IsNil(o.GlossaryVersion) {
|
|
toSerialize["glossary_version"] = o.GlossaryVersion
|
|
}
|
|
if !IsNil(o.Lang) {
|
|
toSerialize["lang"] = o.Lang
|
|
}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.RequestId) {
|
|
toSerialize["request_id"] = o.RequestId
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Target) {
|
|
toSerialize["target"] = o.Target
|
|
}
|
|
if !IsNil(o.Text) {
|
|
toSerialize["text"] = o.Text
|
|
}
|
|
if !IsNil(o.Tier) {
|
|
toSerialize["tier"] = o.Tier
|
|
}
|
|
if !IsNil(o.UpdatedAt) {
|
|
toSerialize["updated_at"] = o.UpdatedAt
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TranslateMemoryEntry) UnmarshalJSON(data []byte) (err error) {
|
|
varTranslateMemoryEntry := _TranslateMemoryEntry{}
|
|
|
|
err = json.Unmarshal(data, &varTranslateMemoryEntry)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TranslateMemoryEntry(varTranslateMemoryEntry)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "actor")
|
|
delete(additionalProperties, "format")
|
|
delete(additionalProperties, "glossary_version")
|
|
delete(additionalProperties, "lang")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "request_id")
|
|
delete(additionalProperties, "source")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "target")
|
|
delete(additionalProperties, "text")
|
|
delete(additionalProperties, "tier")
|
|
delete(additionalProperties, "updated_at")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTranslateMemoryEntry struct {
|
|
value *TranslateMemoryEntry
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTranslateMemoryEntry) Get() *TranslateMemoryEntry {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTranslateMemoryEntry) Set(val *TranslateMemoryEntry) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTranslateMemoryEntry) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTranslateMemoryEntry) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTranslateMemoryEntry(val *TranslateMemoryEntry) *NullableTranslateMemoryEntry {
|
|
return &NullableTranslateMemoryEntry{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTranslateMemoryEntry) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTranslateMemoryEntry) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|