// Code generated by ogen, DO NOT EDIT.
package api
type BearerAuth struct {
Token string
Roles []string
}
// GetToken returns the value of Token.
func (s *BearerAuth) GetToken() string {
return s.Token
}
// GetRoles returns the value of Roles.
func (s *BearerAuth) GetRoles() []string {
return s.Roles
}
// SetToken sets the value of Token.
func (s *BearerAuth) SetToken(val string) {
s.Token = val
}
// SetRoles sets the value of Roles.
func (s *BearerAuth) SetRoles(val []string) {
s.Roles = val
}
// Ref: #/components/schemas/Calendar
type Calendar struct {
ID OptString `json:"id"`
Summary OptNilString `json:"summary"`
Description OptNilString `json:"description"`
TimeZone OptNilString `json:"timeZone"`
}
// GetID returns the value of ID.
func (s *Calendar) GetID() OptString {
return s.ID
}
// GetSummary returns the value of Summary.
func (s *Calendar) GetSummary() OptNilString {
return s.Summary
}
// GetDescription returns the value of Description.
func (s *Calendar) GetDescription() OptNilString {
return s.Description
}
// GetTimeZone returns the value of TimeZone.
func (s *Calendar) GetTimeZone() OptNilString {
return s.TimeZone
}
// SetID sets the value of ID.
func (s *Calendar) SetID(val OptString) {
s.ID = val
}
// SetSummary sets the value of Summary.
func (s *Calendar) SetSummary(val OptNilString) {
s.Summary = val
}
// SetDescription sets the value of Description.
func (s *Calendar) SetDescription(val OptNilString) {
s.Description = val
}
// SetTimeZone sets the value of TimeZone.
func (s *Calendar) SetTimeZone(val OptNilString) {
s.TimeZone = val
}
// Ref: #/components/schemas/CalendarListEntry
type CalendarListEntry struct {
ID OptString `json:"id"`
Summary OptNilString `json:"summary"`
Description OptNilString `json:"description"`
TimeZone OptNilString `json:"timeZone"`
Primary OptNilBool `json:"primary"`
AccessRole OptNilString `json:"accessRole"`
BackgroundColor OptNilString `json:"backgroundColor"`
}
// GetID returns the value of ID.
func (s *CalendarListEntry) GetID() OptString {
return s.ID
}
// GetSummary returns the value of Summary.
func (s *CalendarListEntry) GetSummary() OptNilString {
return s.Summary
}
// GetDescription returns the value of Description.
func (s *CalendarListEntry) GetDescription() OptNilString {
return s.Description
}
// GetTimeZone returns the value of TimeZone.
func (s *CalendarListEntry) GetTimeZone() OptNilString {
return s.TimeZone
}
// GetPrimary returns the value of Primary.
func (s *CalendarListEntry) GetPrimary() OptNilBool {
return s.Primary
}
// GetAccessRole returns the value of AccessRole.
func (s *CalendarListEntry) GetAccessRole() OptNilString {
return s.AccessRole
}
// GetBackgroundColor returns the value of BackgroundColor.
func (s *CalendarListEntry) GetBackgroundColor() OptNilString {
return s.BackgroundColor
}
// SetID sets the value of ID.
func (s *CalendarListEntry) SetID(val OptString) {
s.ID = val
}
// SetSummary sets the value of Summary.
func (s *CalendarListEntry) SetSummary(val OptNilString) {
s.Summary = val
}
// SetDescription sets the value of Description.
func (s *CalendarListEntry) SetDescription(val OptNilString) {
s.Description = val
}
// SetTimeZone sets the value of TimeZone.
func (s *CalendarListEntry) SetTimeZone(val OptNilString) {
s.TimeZone = val
}
// SetPrimary sets the value of Primary.
func (s *CalendarListEntry) SetPrimary(val OptNilBool) {
s.Primary = val
}
// SetAccessRole sets the value of AccessRole.
func (s *CalendarListEntry) SetAccessRole(val OptNilString) {
s.AccessRole = val
}
// SetBackgroundColor sets the value of BackgroundColor.
func (s *CalendarListEntry) SetBackgroundColor(val OptNilString) {
s.BackgroundColor = val
}
// Ref: #/components/schemas/CalendarListResponse
type CalendarListResponse struct {
Kind OptString `json:"kind"`
Items []CalendarListEntry `json:"items"`
}
// GetKind returns the value of Kind.
func (s *CalendarListResponse) GetKind() OptString {
return s.Kind
}
// GetItems returns the value of Items.
func (s *CalendarListResponse) GetItems() []CalendarListEntry {
return s.Items
}
// SetKind sets the value of Kind.
func (s *CalendarListResponse) SetKind(val OptString) {
s.Kind = val
}
// SetItems sets the value of Items.
func (s *CalendarListResponse) SetItems(val []CalendarListEntry) {
s.Items = val
}
// DeleteEventNoContent is response for DeleteEvent operation.
type DeleteEventNoContent struct{}
// Ref: #/components/schemas/Event
type Event struct {
ID OptString `json:"id"`
Status OptNilString `json:"status"`
HtmlLink OptNilString `json:"htmlLink"`
Summary OptNilString `json:"summary"`
Description OptNilString `json:"description"`
Location OptNilString `json:"location"`
Start OptEventDateTime `json:"start"`
End OptEventDateTime `json:"end"`
Attendees OptNilEventAttendeeArray `json:"attendees"`
Created OptNilString `json:"created"`
Updated OptNilString `json:"updated"`
Creator OptNilEventCreator `json:"creator"`
Organizer OptNilEventOrganizer `json:"organizer"`
}
// GetID returns the value of ID.
func (s *Event) GetID() OptString {
return s.ID
}
// GetStatus returns the value of Status.
func (s *Event) GetStatus() OptNilString {
return s.Status
}
// GetHtmlLink returns the value of HtmlLink.
func (s *Event) GetHtmlLink() OptNilString {
return s.HtmlLink
}
// GetSummary returns the value of Summary.
func (s *Event) GetSummary() OptNilString {
return s.Summary
}
// GetDescription returns the value of Description.
func (s *Event) GetDescription() OptNilString {
return s.Description
}
// GetLocation returns the value of Location.
func (s *Event) GetLocation() OptNilString {
return s.Location
}
// GetStart returns the value of Start.
func (s *Event) GetStart() OptEventDateTime {
return s.Start
}
// GetEnd returns the value of End.
func (s *Event) GetEnd() OptEventDateTime {
return s.End
}
// GetAttendees returns the value of Attendees.
func (s *Event) GetAttendees() OptNilEventAttendeeArray {
return s.Attendees
}
// GetCreated returns the value of Created.
func (s *Event) GetCreated() OptNilString {
return s.Created
}
// GetUpdated returns the value of Updated.
func (s *Event) GetUpdated() OptNilString {
return s.Updated
}
// GetCreator returns the value of Creator.
func (s *Event) GetCreator() OptNilEventCreator {
return s.Creator
}
// GetOrganizer returns the value of Organizer.
func (s *Event) GetOrganizer() OptNilEventOrganizer {
return s.Organizer
}
// SetID sets the value of ID.
func (s *Event) SetID(val OptString) {
s.ID = val
}
// SetStatus sets the value of Status.
func (s *Event) SetStatus(val OptNilString) {
s.Status = val
}
// SetHtmlLink sets the value of HtmlLink.
func (s *Event) SetHtmlLink(val OptNilString) {
s.HtmlLink = val
}
// SetSummary sets the value of Summary.
func (s *Event) SetSummary(val OptNilString) {
s.Summary = val
}
// SetDescription sets the value of Description.
func (s *Event) SetDescription(val OptNilString) {
s.Description = val
}
// SetLocation sets the value of Location.
func (s *Event) SetLocation(val OptNilString) {
s.Location = val
}
// SetStart sets the value of Start.
func (s *Event) SetStart(val OptEventDateTime) {
s.Start = val
}
// SetEnd sets the value of End.
func (s *Event) SetEnd(val OptEventDateTime) {
s.End = val
}
// SetAttendees sets the value of Attendees.
func (s *Event) SetAttendees(val OptNilEventAttendeeArray) {
s.Attendees = val
}
// SetCreated sets the value of Created.
func (s *Event) SetCreated(val OptNilString) {
s.Created = val
}
// SetUpdated sets the value of Updated.
func (s *Event) SetUpdated(val OptNilString) {
s.Updated = val
}
// SetCreator sets the value of Creator.
func (s *Event) SetCreator(val OptNilEventCreator) {
s.Creator = val
}
// SetOrganizer sets the value of Organizer.
func (s *Event) SetOrganizer(val OptNilEventOrganizer) {
s.Organizer = val
}
// Ref: #/components/schemas/EventAttendee
type EventAttendee struct {
Email OptString `json:"email"`
DisplayName OptNilString `json:"displayName"`
ResponseStatus OptNilString `json:"responseStatus"`
Self OptNilBool `json:"self"`
Organizer OptNilBool `json:"organizer"`
}
// GetEmail returns the value of Email.
func (s *EventAttendee) GetEmail() OptString {
return s.Email
}
// GetDisplayName returns the value of DisplayName.
func (s *EventAttendee) GetDisplayName() OptNilString {
return s.DisplayName
}
// GetResponseStatus returns the value of ResponseStatus.
func (s *EventAttendee) GetResponseStatus() OptNilString {
return s.ResponseStatus
}
// GetSelf returns the value of Self.
func (s *EventAttendee) GetSelf() OptNilBool {
return s.Self
}
// GetOrganizer returns the value of Organizer.
func (s *EventAttendee) GetOrganizer() OptNilBool {
return s.Organizer
}
// SetEmail sets the value of Email.
func (s *EventAttendee) SetEmail(val OptString) {
s.Email = val
}
// SetDisplayName sets the value of DisplayName.
func (s *EventAttendee) SetDisplayName(val OptNilString) {
s.DisplayName = val
}
// SetResponseStatus sets the value of ResponseStatus.
func (s *EventAttendee) SetResponseStatus(val OptNilString) {
s.ResponseStatus = val
}
// SetSelf sets the value of Self.
func (s *EventAttendee) SetSelf(val OptNilBool) {
s.Self = val
}
// SetOrganizer sets the value of Organizer.
func (s *EventAttendee) SetOrganizer(val OptNilBool) {
s.Organizer = val
}
type EventCreator struct {
Email OptString `json:"email"`
DisplayName OptNilString `json:"displayName"`
}
// GetEmail returns the value of Email.
func (s *EventCreator) GetEmail() OptString {
return s.Email
}
// GetDisplayName returns the value of DisplayName.
func (s *EventCreator) GetDisplayName() OptNilString {
return s.DisplayName
}
// SetEmail sets the value of Email.
func (s *EventCreator) SetEmail(val OptString) {
s.Email = val
}
// SetDisplayName sets the value of DisplayName.
func (s *EventCreator) SetDisplayName(val OptNilString) {
s.DisplayName = val
}
// Ref: #/components/schemas/EventDateTime
type EventDateTime struct {
// Date for all-day events (YYYY-MM-DD).
Date OptNilString `json:"date"`
// Date-time (RFC3339).
DateTime OptNilString `json:"dateTime"`
TimeZone OptNilString `json:"timeZone"`
}
// GetDate returns the value of Date.
func (s *EventDateTime) GetDate() OptNilString {
return s.Date
}
// GetDateTime returns the value of DateTime.
func (s *EventDateTime) GetDateTime() OptNilString {
return s.DateTime
}
// GetTimeZone returns the value of TimeZone.
func (s *EventDateTime) GetTimeZone() OptNilString {
return s.TimeZone
}
// SetDate sets the value of Date.
func (s *EventDateTime) SetDate(val OptNilString) {
s.Date = val
}
// SetDateTime sets the value of DateTime.
func (s *EventDateTime) SetDateTime(val OptNilString) {
s.DateTime = val
}
// SetTimeZone sets the value of TimeZone.
func (s *EventDateTime) SetTimeZone(val OptNilString) {
s.TimeZone = val
}
// Ref: #/components/schemas/EventListResponse
type EventListResponse struct {
Kind OptString `json:"kind"`
Summary OptNilString `json:"summary"`
Items []Event `json:"items"`
NextPageToken OptNilString `json:"nextPageToken"`
}
// GetKind returns the value of Kind.
func (s *EventListResponse) GetKind() OptString {
return s.Kind
}
// GetSummary returns the value of Summary.
func (s *EventListResponse) GetSummary() OptNilString {
return s.Summary
}
// GetItems returns the value of Items.
func (s *EventListResponse) GetItems() []Event {
return s.Items
}
// GetNextPageToken returns the value of NextPageToken.
func (s *EventListResponse) GetNextPageToken() OptNilString {
return s.NextPageToken
}
// SetKind sets the value of Kind.
func (s *EventListResponse) SetKind(val OptString) {
s.Kind = val
}
// SetSummary sets the value of Summary.
func (s *EventListResponse) SetSummary(val OptNilString) {
s.Summary = val
}
// SetItems sets the value of Items.
func (s *EventListResponse) SetItems(val []Event) {
s.Items = val
}
// SetNextPageToken sets the value of NextPageToken.
func (s *EventListResponse) SetNextPageToken(val OptNilString) {
s.NextPageToken = val
}
type EventOrganizer struct {
Email OptString `json:"email"`
DisplayName OptNilString `json:"displayName"`
}
// GetEmail returns the value of Email.
func (s *EventOrganizer) GetEmail() OptString {
return s.Email
}
// GetDisplayName returns the value of DisplayName.
func (s *EventOrganizer) GetDisplayName() OptNilString {
return s.DisplayName
}
// SetEmail sets the value of Email.
func (s *EventOrganizer) SetEmail(val OptString) {
s.Email = val
}
// SetDisplayName sets the value of DisplayName.
func (s *EventOrganizer) SetDisplayName(val OptNilString) {
s.DisplayName = val
}
// Ref: #/components/schemas/EventRequest
type EventRequest struct {
Summary OptNilString `json:"summary"`
Description OptNilString `json:"description"`
Location OptNilString `json:"location"`
Start OptEventDateTime `json:"start"`
End OptEventDateTime `json:"end"`
Attendees OptNilEventAttendeeArray `json:"attendees"`
}
// GetSummary returns the value of Summary.
func (s *EventRequest) GetSummary() OptNilString {
return s.Summary
}
// GetDescription returns the value of Description.
func (s *EventRequest) GetDescription() OptNilString {
return s.Description
}
// GetLocation returns the value of Location.
func (s *EventRequest) GetLocation() OptNilString {
return s.Location
}
// GetStart returns the value of Start.
func (s *EventRequest) GetStart() OptEventDateTime {
return s.Start
}
// GetEnd returns the value of End.
func (s *EventRequest) GetEnd() OptEventDateTime {
return s.End
}
// GetAttendees returns the value of Attendees.
func (s *EventRequest) GetAttendees() OptNilEventAttendeeArray {
return s.Attendees
}
// SetSummary sets the value of Summary.
func (s *EventRequest) SetSummary(val OptNilString) {
s.Summary = val
}
// SetDescription sets the value of Description.
func (s *EventRequest) SetDescription(val OptNilString) {
s.Description = val
}
// SetLocation sets the value of Location.
func (s *EventRequest) SetLocation(val OptNilString) {
s.Location = val
}
// SetStart sets the value of Start.
func (s *EventRequest) SetStart(val OptEventDateTime) {
s.Start = val
}
// SetEnd sets the value of End.
func (s *EventRequest) SetEnd(val OptEventDateTime) {
s.End = val
}
// SetAttendees sets the value of Attendees.
func (s *EventRequest) SetAttendees(val OptNilEventAttendeeArray) {
s.Attendees = val
}
// NewOptBool returns new OptBool with value set to v.
func NewOptBool(v bool) OptBool {
return OptBool{
Value: v,
Set: true,
}
}
// OptBool is optional bool.
type OptBool struct {
Value bool
Set bool
}
// IsSet returns true if OptBool was set.
func (o OptBool) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptBool) Reset() {
var v bool
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptBool) SetTo(v bool) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptBool) Get() (v bool, ok bool) {
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptBool) Or(d bool) bool {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptEventDateTime returns new OptEventDateTime with value set to v.
func NewOptEventDateTime(v EventDateTime) OptEventDateTime {
return OptEventDateTime{
Value: v,
Set: true,
}
}
// OptEventDateTime is optional EventDateTime.
type OptEventDateTime struct {
Value EventDateTime
Set bool
}
// IsSet returns true if OptEventDateTime was set.
func (o OptEventDateTime) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptEventDateTime) Reset() {
var v EventDateTime
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptEventDateTime) SetTo(v EventDateTime) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptEventDateTime) Get() (v EventDateTime, ok bool) {
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptEventDateTime) Or(d EventDateTime) EventDateTime {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptInt returns new OptInt with value set to v.
func NewOptInt(v int) OptInt {
return OptInt{
Value: v,
Set: true,
}
}
// OptInt is optional int.
type OptInt struct {
Value int
Set bool
}
// IsSet returns true if OptInt was set.
func (o OptInt) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptInt) Reset() {
var v int
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptInt) SetTo(v int) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptInt) Get() (v int, ok bool) {
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptInt) Or(d int) int {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptNilBool returns new OptNilBool with value set to v.
func NewOptNilBool(v bool) OptNilBool {
return OptNilBool{
Value: v,
Set: true,
}
}
// OptNilBool is optional nullable bool.
type OptNilBool struct {
Value bool
Set bool
Null bool
}
// IsSet returns true if OptNilBool was set.
func (o OptNilBool) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptNilBool) Reset() {
var v bool
o.Value = v
o.Set = false
o.Null = false
}
// SetTo sets value to v.
func (o *OptNilBool) SetTo(v bool) {
o.Set = true
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o OptNilBool) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *OptNilBool) SetToNull() {
o.Set = true
o.Null = true
var v bool
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptNilBool) Get() (v bool, ok bool) {
if o.Null {
return v, false
}
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptNilBool) Or(d bool) bool {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptNilEventAttendeeArray returns new OptNilEventAttendeeArray with value set to v.
func NewOptNilEventAttendeeArray(v []EventAttendee) OptNilEventAttendeeArray {
return OptNilEventAttendeeArray{
Value: v,
Set: true,
}
}
// OptNilEventAttendeeArray is optional nullable []EventAttendee.
type OptNilEventAttendeeArray struct {
Value []EventAttendee
Set bool
Null bool
}
// IsSet returns true if OptNilEventAttendeeArray was set.
func (o OptNilEventAttendeeArray) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptNilEventAttendeeArray) Reset() {
var v []EventAttendee
o.Value = v
o.Set = false
o.Null = false
}
// SetTo sets value to v.
func (o *OptNilEventAttendeeArray) SetTo(v []EventAttendee) {
o.Set = true
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o OptNilEventAttendeeArray) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *OptNilEventAttendeeArray) SetToNull() {
o.Set = true
o.Null = true
var v []EventAttendee
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptNilEventAttendeeArray) Get() (v []EventAttendee, ok bool) {
if o.Null {
return v, false
}
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptNilEventAttendeeArray) Or(d []EventAttendee) []EventAttendee {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptNilEventCreator returns new OptNilEventCreator with value set to v.
func NewOptNilEventCreator(v EventCreator) OptNilEventCreator {
return OptNilEventCreator{
Value: v,
Set: true,
}
}
// OptNilEventCreator is optional nullable EventCreator.
type OptNilEventCreator struct {
Value EventCreator
Set bool
Null bool
}
// IsSet returns true if OptNilEventCreator was set.
func (o OptNilEventCreator) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptNilEventCreator) Reset() {
var v EventCreator
o.Value = v
o.Set = false
o.Null = false
}
// SetTo sets value to v.
func (o *OptNilEventCreator) SetTo(v EventCreator) {
o.Set = true
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o OptNilEventCreator) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *OptNilEventCreator) SetToNull() {
o.Set = true
o.Null = true
var v EventCreator
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptNilEventCreator) Get() (v EventCreator, ok bool) {
if o.Null {
return v, false
}
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptNilEventCreator) Or(d EventCreator) EventCreator {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptNilEventOrganizer returns new OptNilEventOrganizer with value set to v.
func NewOptNilEventOrganizer(v EventOrganizer) OptNilEventOrganizer {
return OptNilEventOrganizer{
Value: v,
Set: true,
}
}
// OptNilEventOrganizer is optional nullable EventOrganizer.
type OptNilEventOrganizer struct {
Value EventOrganizer
Set bool
Null bool
}
// IsSet returns true if OptNilEventOrganizer was set.
func (o OptNilEventOrganizer) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptNilEventOrganizer) Reset() {
var v EventOrganizer
o.Value = v
o.Set = false
o.Null = false
}
// SetTo sets value to v.
func (o *OptNilEventOrganizer) SetTo(v EventOrganizer) {
o.Set = true
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o OptNilEventOrganizer) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *OptNilEventOrganizer) SetToNull() {
o.Set = true
o.Null = true
var v EventOrganizer
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptNilEventOrganizer) Get() (v EventOrganizer, ok bool) {
if o.Null {
return v, false
}
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptNilEventOrganizer) Or(d EventOrganizer) EventOrganizer {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptNilString returns new OptNilString with value set to v.
func NewOptNilString(v string) OptNilString {
return OptNilString{
Value: v,
Set: true,
}
}
// OptNilString is optional nullable string.
type OptNilString struct {
Value string
Set bool
Null bool
}
// IsSet returns true if OptNilString was set.
func (o OptNilString) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptNilString) Reset() {
var v string
o.Value = v
o.Set = false
o.Null = false
}
// SetTo sets value to v.
func (o *OptNilString) SetTo(v string) {
o.Set = true
o.Null = false
o.Value = v
}
// IsNull returns true if value is Null.
func (o OptNilString) IsNull() bool { return o.Null }
// SetToNull sets value to null.
func (o *OptNilString) SetToNull() {
o.Set = true
o.Null = true
var v string
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptNilString) Get() (v string, ok bool) {
if o.Null {
return v, false
}
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptNilString) Or(d string) string {
if v, ok := o.Get(); ok {
return v
}
return d
}
// NewOptString returns new OptString with value set to v.
func NewOptString(v string) OptString {
return OptString{
Value: v,
Set: true,
}
}
// OptString is optional string.
type OptString struct {
Value string
Set bool
}
// IsSet returns true if OptString was set.
func (o OptString) IsSet() bool { return o.Set }
// Reset unsets value.
func (o *OptString) Reset() {
var v string
o.Value = v
o.Set = false
}
// SetTo sets value to v.
func (o *OptString) SetTo(v string) {
o.Set = true
o.Value = v
}
// Get returns value and boolean that denotes whether value was set.
func (o OptString) Get() (v string, ok bool) {
if !o.Set {
return v, false
}
return o.Value, true
}
// Or returns value if set, or given parameter if does not.
func (o OptString) Or(d string) string {
if v, ok := o.Get(); ok {
return v
}
return d
}