153 lines
4.7 KiB
Go
153 lines
4.7 KiB
Go
/*
|
|
SpaceTraders API
|
|
|
|
SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe. The API is documented using [OpenAPI](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server. ```json http { \"method\": \"GET\", \"url\": \"https://api.spacetraders.io/v2\", } ``` Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community. We have a [Discord channel](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.
|
|
|
|
API version: 2.0.0
|
|
Contact: joel@spacetraders.io
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package spacetraders
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the ShipyardShipTypesInner type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ShipyardShipTypesInner{}
|
|
|
|
// ShipyardShipTypesInner struct for ShipyardShipTypesInner
|
|
type ShipyardShipTypesInner struct {
|
|
Type *ShipType `json:"type,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ShipyardShipTypesInner ShipyardShipTypesInner
|
|
|
|
// NewShipyardShipTypesInner instantiates a new ShipyardShipTypesInner 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 NewShipyardShipTypesInner() *ShipyardShipTypesInner {
|
|
this := ShipyardShipTypesInner{}
|
|
return &this
|
|
}
|
|
|
|
// NewShipyardShipTypesInnerWithDefaults instantiates a new ShipyardShipTypesInner 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 NewShipyardShipTypesInnerWithDefaults() *ShipyardShipTypesInner {
|
|
this := ShipyardShipTypesInner{}
|
|
return &this
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *ShipyardShipTypesInner) GetType() ShipType {
|
|
if o == nil || isNil(o.Type) {
|
|
var ret ShipType
|
|
return ret
|
|
}
|
|
return *o.Type
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ShipyardShipTypesInner) GetTypeOk() (*ShipType, bool) {
|
|
if o == nil || isNil(o.Type) {
|
|
return nil, false
|
|
}
|
|
return o.Type, true
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *ShipyardShipTypesInner) HasType() bool {
|
|
if o != nil && !isNil(o.Type) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetType gets a reference to the given ShipType and assigns it to the Type field.
|
|
func (o *ShipyardShipTypesInner) SetType(v ShipType) {
|
|
o.Type = &v
|
|
}
|
|
|
|
func (o ShipyardShipTypesInner) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ShipyardShipTypesInner) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !isNil(o.Type) {
|
|
toSerialize["type"] = o.Type
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ShipyardShipTypesInner) UnmarshalJSON(bytes []byte) (err error) {
|
|
varShipyardShipTypesInner := _ShipyardShipTypesInner{}
|
|
|
|
if err = json.Unmarshal(bytes, &varShipyardShipTypesInner); err == nil {
|
|
*o = ShipyardShipTypesInner(varShipyardShipTypesInner)
|
|
}
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "type")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableShipyardShipTypesInner struct {
|
|
value *ShipyardShipTypesInner
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableShipyardShipTypesInner) Get() *ShipyardShipTypesInner {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableShipyardShipTypesInner) Set(val *ShipyardShipTypesInner) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableShipyardShipTypesInner) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableShipyardShipTypesInner) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableShipyardShipTypesInner(val *ShipyardShipTypesInner) *NullableShipyardShipTypesInner {
|
|
return &NullableShipyardShipTypesInner{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableShipyardShipTypesInner) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableShipyardShipTypesInner) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|