core

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemaRequired = &options{
		Required: true,
	}

	SchemaOptional = &options{
		Optional: true,
	}

	SchemaComputed = &options{
		Computed: true,
	}

	SchemaComputedOptional = &options{
		Computed: true,
		Optional: true,
	}

	SchemaComputedSensitive = &options{
		Computed:  true,
		Sensitive: true,
	}

	SchemaForceNewRequired = &options{
		Required: true,
		ForceNew: true,
	}

	SchemaForceNewOptional = &options{
		ForceNew: true,
		Computed: true,
		Optional: true,
	}
)
View Source
var TwilioErrorGeneric = errTwilio()

Functions

func AsBool

func AsBool(conf *options) *schema.Schema

func AsFloat

func AsFloat(conf *options) *schema.Schema

func AsInt

func AsInt(conf *options) *schema.Schema

func AsList

func AsList(obj interface{}, conf *options) *schema.Schema

func AsMap

func AsMap(obj interface{}, conf *options) *schema.Schema

func AsSid

func AsSid(sid SidInterface, conf *options) *schema.Schema

func AsString

func AsString(conf *options) *schema.Schema

func CreateErrorGeneric

func CreateErrorGeneric(message string) error

func FormEncoder

func FormEncoder(src interface{}) (url.Values, error)

func IntToString

func IntToString(input int) string

func MarshalSchema

func MarshalSchema(resourceData *schema.ResourceData, src interface{}) error

From provider (resourceData) to structure (client) presentation

func QueryEncoder

func QueryEncoder(src interface{}) (string, error)

func StringToInt added in v0.5.0

func StringToInt(input string) (int, error)

func ToSnakeCase

func ToSnakeCase(str string) string

func UnmarshalSchema

func UnmarshalSchema(dest interface{}, resourceData *schema.ResourceData) error

From structure (client) presentation to provider (resourceData)

func WrapError

func WrapError(err error, status int, code int, message string) error

func WrapErrorGeneric

func WrapErrorGeneric(err error, message string) error

func WrapErrorStatus

func WrapErrorStatus(err error, status int, message string) error

Types

type AccountSid

type AccountSid struct {
	Sid `prefix:"AC"`
}

func CreateAccountSid

func CreateAccountSid(str string) (AccountSid, error)

func (*AccountSid) Set

func (sid *AccountSid) Set(value interface{}) error

func (*AccountSid) UnmarshalJSON

func (sid *AccountSid) UnmarshalJSON(buffer []byte) error

type ActivitySid

type ActivitySid struct {
	Sid `prefix:"WA"`
}

func CreateActivitySid

func CreateActivitySid(str string) (ActivitySid, error)

func (*ActivitySid) Set

func (sid *ActivitySid) Set(value interface{}) error

func (*ActivitySid) UnmarshalJSON

func (sid *ActivitySid) UnmarshalJSON(buffer []byte) error

type ChatRoleSid

type ChatRoleSid struct {
	Sid `prefix:"RL"`
}

func CreateChatRoleSid

func CreateChatRoleSid(str string) (ChatRoleSid, error)

func (*ChatRoleSid) Set

func (sid *ChatRoleSid) Set(value interface{}) error

func (*ChatRoleSid) UnmarshalJSON

func (sid *ChatRoleSid) UnmarshalJSON(buffer []byte) error

type DecoratedBasicTypeGetterInterface

type DecoratedBasicTypeGetterInterface interface {
	GetNativePresentation() (interface{}, bool)
	Get() (interface{}, bool)
}

type DecoratedBasicTypeInterface

type DecoratedBasicTypeInterface interface {
	Set(value interface{}) error
	GetNativePresentation() (interface{}, bool)
	Get() (interface{}, bool)
}

type FlexFlowSid

type FlexFlowSid struct {
	Sid `prefix:"FO"`
}

func CreateFlexFlowSid

func CreateFlexFlowSid(str string) (FlexFlowSid, error)

func (*FlexFlowSid) Set

func (sid *FlexFlowSid) Set(value interface{}) error

func (*FlexFlowSid) UnmarshalJSON

func (sid *FlexFlowSid) UnmarshalJSON(buffer []byte) error

type IdentityRealmCertificateSid

type IdentityRealmCertificateSid struct {
	Sid `prefix:"JC"`
}

func CreateIdentityRealmCertificateSid

func CreateIdentityRealmCertificateSid(str string) (IdentityRealmCertificateSid, error)

func (*IdentityRealmCertificateSid) Set

func (sid *IdentityRealmCertificateSid) Set(value interface{}) error

func (*IdentityRealmCertificateSid) UnmarshalJSON

func (sid *IdentityRealmCertificateSid) UnmarshalJSON(buffer []byte) error

type IdentityRealmRoleSid

type IdentityRealmRoleSid struct {
	Sid `prefix:"JD"`
}

func CreateIdentityRealmRoleSid

func CreateIdentityRealmRoleSid(str string) (IdentityRealmRoleSid, error)

func (*IdentityRealmRoleSid) Set

func (sid *IdentityRealmRoleSid) Set(value interface{}) error

func (*IdentityRealmRoleSid) UnmarshalJSON

func (sid *IdentityRealmRoleSid) UnmarshalJSON(buffer []byte) error

type IdentityRealmSid

type IdentityRealmSid struct {
	Sid `prefix:"JB"`
}

func CreateIdentityRealmSid

func CreateIdentityRealmSid(str string) (IdentityRealmSid, error)

func (*IdentityRealmSid) Set

func (sid *IdentityRealmSid) Set(value interface{}) error

func (*IdentityRealmSid) UnmarshalJSON

func (sid *IdentityRealmSid) UnmarshalJSON(buffer []byte) error

type NullableBool

type NullableBool struct {
	Valid bool
	Value bool
}

func (NullableBool) Get

func (nullable NullableBool) Get() (interface{}, bool)

func (NullableBool) GetNativePresentation

func (nullable NullableBool) GetNativePresentation() (interface{}, bool)

func (NullableBool) MarshalJSON

func (nullable NullableBool) MarshalJSON() ([]byte, error)

json marshaling

func (*NullableBool) Set

func (nullable *NullableBool) Set(value interface{}) error

func (*NullableBool) UnmarshalJSON

func (nullable *NullableBool) UnmarshalJSON(buffer []byte) error

type NullableFloat

type NullableFloat struct {
	Valid bool
	Value float64
}

func (NullableFloat) Get

func (nullable NullableFloat) Get() (interface{}, bool)

func (NullableFloat) GetNativePresentation

func (nullable NullableFloat) GetNativePresentation() (interface{}, bool)

func (NullableFloat) MarshalJSON

func (nullable NullableFloat) MarshalJSON() ([]byte, error)

json marshaling

func (*NullableFloat) Set

func (nullable *NullableFloat) Set(value interface{}) error

func (*NullableFloat) UnmarshalJSON

func (nullable *NullableFloat) UnmarshalJSON(buffer []byte) error

type NullableInt

type NullableInt struct {
	Valid bool
	Value int64
}

func (NullableInt) Get

func (nullable NullableInt) Get() (interface{}, bool)

func (NullableInt) GetNativePresentation

func (nullable NullableInt) GetNativePresentation() (interface{}, bool)

func (NullableInt) MarshalJSON

func (nullable NullableInt) MarshalJSON() ([]byte, error)

json marshaling

func (*NullableInt) Set

func (nullable *NullableInt) Set(value interface{}) error

func (*NullableInt) UnmarshalJSON

func (nullable *NullableInt) UnmarshalJSON(buffer []byte) error

type NullableString

type NullableString struct {
	Valid bool
	Value string
}

func (NullableString) Get

func (nullable NullableString) Get() (interface{}, bool)

DecoratedBasicTypeInterface

func (NullableString) GetNativePresentation

func (nullable NullableString) GetNativePresentation() (interface{}, bool)

func (NullableString) MarshalJSON

func (nullable NullableString) MarshalJSON() ([]byte, error)

json marshaling

func (*NullableString) Set

func (nullable *NullableString) Set(value interface{}) error

func (*NullableString) UnmarshalJSON

func (nullable *NullableString) UnmarshalJSON(buffer []byte) error

type PhoneNumberSid

type PhoneNumberSid struct {
	Sid `prefix:"PN"`
}

func CreatePhoneNumberSid

func CreatePhoneNumberSid(str string) (PhoneNumberSid, error)

func (*PhoneNumberSid) Set

func (sid *PhoneNumberSid) Set(value interface{}) error

func (*PhoneNumberSid) UnmarshalJSON

func (sid *PhoneNumberSid) UnmarshalJSON(buffer []byte) error

type ProxyServiceSid

type ProxyServiceSid struct {
	Sid `prefix:"KS"`
}

func CreateProxyServiceSid

func CreateProxyServiceSid(str string) (ProxyServiceSid, error)

func (*ProxyServiceSid) Set

func (sid *ProxyServiceSid) Set(value interface{}) error

func (*ProxyServiceSid) UnmarshalJSON

func (sid *ProxyServiceSid) UnmarshalJSON(buffer []byte) error

type QuotaSid

type QuotaSid struct {
	Sid `prefix:"QA"`
}

func CreateQuotaSid

func CreateQuotaSid(str string) (QuotaSid, error)

func (*QuotaSid) Set

func (sid *QuotaSid) Set(value interface{}) error

func (*QuotaSid) UnmarshalJSON

func (sid *QuotaSid) UnmarshalJSON(buffer []byte) error

type RequestSid

type RequestSid struct {
	Sid `prefix:"RQ"`
}

func CreateRequestSid

func CreateRequestSid(str string) (RequestSid, error)

func (*RequestSid) Set

func (sid *RequestSid) Set(value interface{}) error

func (*RequestSid) UnmarshalJSON

func (sid *RequestSid) UnmarshalJSON(buffer []byte) error

type SchemaPlus

type SchemaPlus struct {
	*schema.Schema
}

type ServiceInstanceSid

type ServiceInstanceSid struct {
	Sid `prefix:"IS"`
}

func CreateServiceInstanceSid

func CreateServiceInstanceSid(str string) (ServiceInstanceSid, error)

func (*ServiceInstanceSid) Set

func (sid *ServiceInstanceSid) Set(value interface{}) error

func (*ServiceInstanceSid) UnmarshalJSON

func (sid *ServiceInstanceSid) UnmarshalJSON(buffer []byte) error

type Sid

type Sid struct {
	Valid  bool
	Prefix [2]byte
	Value  [16]byte
}

func CreateSid

func CreateSid(str string) (Sid, error)

func (Sid) Get

func (sid Sid) Get() (interface{}, bool)

DecoratedBasicTypeInterface

func (Sid) GetNativePresentation

func (sid Sid) GetNativePresentation() (interface{}, bool)

func (Sid) MarshalJSON

func (sid Sid) MarshalJSON() ([]byte, error)

func (*Sid) Randomize

func (sid *Sid) Randomize(t interface{}) error

Randomize sid value (useful for creating new) PS! t must be an interface t cannot be a t *interface{} because you Cannot use any other sid (type RequestSid) as type *interface{}

func (*Sid) Set

func (sid *Sid) Set(value interface{}) error

func (Sid) String

func (sid Sid) String() string

Stringer

func (*Sid) UnmarshalJSON

func (sid *Sid) UnmarshalJSON(buffer []byte) error

json marshaling

type SidInterface

type SidInterface interface {
	Set(value interface{}) error
	Get() (interface{}, bool)
	UnmarshalJSON(buffer []byte) error
	MarshalJSON() ([]byte, error)
}

type StudioFlowSid

type StudioFlowSid struct {
	Sid `prefix:"FW"`
}

func CreateStudioFlowSid

func CreateStudioFlowSid(str string) (StudioFlowSid, error)

func (*StudioFlowSid) Set

func (sid *StudioFlowSid) Set(value interface{}) error

func (*StudioFlowSid) UnmarshalJSON

func (sid *StudioFlowSid) UnmarshalJSON(buffer []byte) error

type StudioStateSid

type StudioStateSid struct {
	Sid `prefix:"FF"`
}

func CreateStudioStateSid

func CreateStudioStateSid(str string) (StudioStateSid, error)

func (*StudioStateSid) Set

func (sid *StudioStateSid) Set(value interface{}) error

func (*StudioStateSid) UnmarshalJSON

func (sid *StudioStateSid) UnmarshalJSON(buffer []byte) error

type TagOptions

type TagOptions []string

func ParseTag

func ParseTag(tag string) (string, TagOptions)

func (TagOptions) Contains

func (o TagOptions) Contains(option string) bool

type TaskChannelSid

type TaskChannelSid struct {
	Sid `prefix:"TC"`
}

func CreateTaskChannelSid

func CreateTaskChannelSid(str string) (TaskChannelSid, error)

func (*TaskChannelSid) Set

func (sid *TaskChannelSid) Set(value interface{}) error

func (*TaskChannelSid) UnmarshalJSON

func (sid *TaskChannelSid) UnmarshalJSON(buffer []byte) error

type TwilioError

type TwilioError struct {
	Cause   error
	Status  int
	Code    int    `json:"code"`
	Message string `json:"message"`
}

TwilioError provides information about an unsuccessful request.

func (TwilioError) Error

func (err TwilioError) Error() string

func (TwilioError) Is

func (err TwilioError) Is(target error) bool

type UserSid

type UserSid struct {
	Sid `prefix:"US"`
}

func CreateUserSid

func CreateUserSid(str string) (UserSid, error)

func (*UserSid) Set

func (sid *UserSid) Set(value interface{}) error

func (*UserSid) UnmarshalJSON

func (sid *UserSid) UnmarshalJSON(buffer []byte) error

type WorkflowSid

type WorkflowSid struct {
	Sid `prefix:"WW"`
}

func CreateWorkflowSid

func CreateWorkflowSid(str string) (WorkflowSid, error)

func (*WorkflowSid) Set

func (sid *WorkflowSid) Set(value interface{}) error

func (*WorkflowSid) UnmarshalJSON

func (sid *WorkflowSid) UnmarshalJSON(buffer []byte) error

type WorkqueueSid

type WorkqueueSid struct {
	Sid `prefix:"WQ"`
}

func CreateWorkqueueSid

func CreateWorkqueueSid(str string) (WorkqueueSid, error)

func (*WorkqueueSid) Set

func (sid *WorkqueueSid) Set(value interface{}) error

func (*WorkqueueSid) UnmarshalJSON

func (sid *WorkqueueSid) UnmarshalJSON(buffer []byte) error

type WorkspaceSid

type WorkspaceSid struct {
	Sid `prefix:"WS"`
}

func CreateWorkspaceSid

func CreateWorkspaceSid(str string) (WorkspaceSid, error)

func (*WorkspaceSid) Set

func (sid *WorkspaceSid) Set(value interface{}) error

func (*WorkspaceSid) UnmarshalJSON

func (sid *WorkspaceSid) UnmarshalJSON(buffer []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL