mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
176 lines
4.6 KiB
Go
176 lines
4.6 KiB
Go
/*
|
|
Membership API
|
|
|
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
|
|
API version: 0.1.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package membershipclient
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// Action the model 'Action'
|
|
type Action string
|
|
|
|
// List of Action
|
|
const (
|
|
AGENTS_CONNECTED Action = "agents.connected"
|
|
AGENTS_DISCONNECTED Action = "agents.disconnected"
|
|
INVITATIONS_CREATED Action = "invitations.created"
|
|
INVITATIONS_ACCEPTED Action = "invitations.accepted"
|
|
INVITATIONS_REJECTED Action = "invitations.rejected"
|
|
ORGANIZATIONS_CREATED Action = "organizations.created"
|
|
ORGANIZATIONS_UPDATED Action = "organizations.updated"
|
|
ORGANIZATIONS_DELETED Action = "organizations.deleted"
|
|
ORGANIZATIONS_USER_DELETED Action = "organizations.user.deleted"
|
|
ORGANIZATIONS_USER_UPDATED Action = "organizations.user.updated"
|
|
REGIONS_CREATED Action = "regions.created"
|
|
REGIONS_DELETED Action = "regions.deleted"
|
|
USERS_CREATED Action = "users.created"
|
|
USERS_DELETED Action = "users.deleted"
|
|
STACKS_DISPOSAL Action = "stacks.disposal"
|
|
STACKS_DISPOSAL_RESET Action = "stacks.disposal-reset"
|
|
STACKS_WARNED Action = "stacks.warned"
|
|
STACKS_PRUNED Action = "stacks.pruned"
|
|
STACKS_STATUS_UPDATED Action = "stacks.status.updated"
|
|
STACKS_CREATED Action = "stacks.created"
|
|
STACKS_UPDATED Action = "stacks.updated"
|
|
STACKS_DELETED Action = "stacks.deleted"
|
|
STACKS_RESTORED Action = "stacks.restored"
|
|
STACKS_DISABLED Action = "stacks.disabled"
|
|
STACKS_ENABLED Action = "stacks.enabled"
|
|
STACKS_UPGRADED Action = "stacks.upgraded"
|
|
STACKS_STARGATE_ENABLED Action = "stacks.stargate.enabled"
|
|
STACKS_STARGATE_DISABLED Action = "stacks.stargate.disabled"
|
|
STACKS_USER_UPDATED Action = "stacks.user.updated"
|
|
STACKS_USER_DELETED Action = "stacks.user.deleted"
|
|
STACKS_REACHNESS_UPDATED Action = "stacks.reachness.updated"
|
|
STACKS_MODULE_ENABLED Action = "stacks.module.enabled"
|
|
STACKS_MODULE_DISABLED Action = "stacks.module.disabled"
|
|
STACKS_MODULE_STATUS_UPDATED Action = "stacks.module.status.updated"
|
|
)
|
|
|
|
// All allowed values of Action enum
|
|
var AllowedActionEnumValues = []Action{
|
|
"agents.connected",
|
|
"agents.disconnected",
|
|
"invitations.created",
|
|
"invitations.accepted",
|
|
"invitations.rejected",
|
|
"organizations.created",
|
|
"organizations.updated",
|
|
"organizations.deleted",
|
|
"organizations.user.deleted",
|
|
"organizations.user.updated",
|
|
"regions.created",
|
|
"regions.deleted",
|
|
"users.created",
|
|
"users.deleted",
|
|
"stacks.disposal",
|
|
"stacks.disposal-reset",
|
|
"stacks.warned",
|
|
"stacks.pruned",
|
|
"stacks.status.updated",
|
|
"stacks.created",
|
|
"stacks.updated",
|
|
"stacks.deleted",
|
|
"stacks.restored",
|
|
"stacks.disabled",
|
|
"stacks.enabled",
|
|
"stacks.upgraded",
|
|
"stacks.stargate.enabled",
|
|
"stacks.stargate.disabled",
|
|
"stacks.user.updated",
|
|
"stacks.user.deleted",
|
|
"stacks.reachness.updated",
|
|
"stacks.module.enabled",
|
|
"stacks.module.disabled",
|
|
"stacks.module.status.updated",
|
|
}
|
|
|
|
func (v *Action) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := Action(value)
|
|
for _, existing := range AllowedActionEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid Action", value)
|
|
}
|
|
|
|
// NewActionFromValue returns a pointer to a valid Action
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewActionFromValue(v string) (*Action, error) {
|
|
ev := Action(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for Action: valid values are %v", v, AllowedActionEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v Action) IsValid() bool {
|
|
for _, existing := range AllowedActionEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to Action value
|
|
func (v Action) Ptr() *Action {
|
|
return &v
|
|
}
|
|
|
|
type NullableAction struct {
|
|
value *Action
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAction) Get() *Action {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAction) Set(val *Action) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAction) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAction) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAction(val *Action) *NullableAction {
|
|
return &NullableAction{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAction) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAction) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|