short/internal/oas/oas_schemas_gen.go

120 lines
2.6 KiB
Go
Raw Normal View History

2024-01-29 18:32:16 +00:00
// Code generated by ogen, DO NOT EDIT.
package oas
type CreateShortURLBadRequest struct {
2024-01-29 18:32:16 +00:00
Message OptString `json:"message"`
}
// GetMessage returns the value of Message.
func (s *CreateShortURLBadRequest) GetMessage() OptString {
2024-01-29 18:32:16 +00:00
return s.Message
}
// SetMessage sets the value of Message.
func (s *CreateShortURLBadRequest) SetMessage(val OptString) {
2024-01-29 18:32:16 +00:00
s.Message = val
}
func (*CreateShortURLBadRequest) createShortURLRes() {}
2024-01-29 18:32:16 +00:00
type CreateShortURLCreated struct {
2024-01-29 18:32:16 +00:00
// Created shorten URL. Going to this URL should redirect to URL from request body.
2024-01-29 20:21:23 +00:00
Shorten string `json:"shorten"`
2024-01-29 18:32:16 +00:00
}
// GetShorten returns the value of Shorten.
2024-01-29 20:21:23 +00:00
func (s *CreateShortURLCreated) GetShorten() string {
2024-01-29 18:32:16 +00:00
return s.Shorten
}
// SetShorten sets the value of Shorten.
2024-01-29 20:21:23 +00:00
func (s *CreateShortURLCreated) SetShorten(val string) {
2024-01-29 18:32:16 +00:00
s.Shorten = val
}
func (*CreateShortURLCreated) createShortURLRes() {}
2024-01-29 18:32:16 +00:00
type CreateShortURLReq struct {
2024-01-29 18:32:16 +00:00
// URL to shorten.
URL string `json:"url"`
}
// GetURL returns the value of URL.
func (s *CreateShortURLReq) GetURL() string {
2024-01-29 18:32:16 +00:00
return s.URL
}
// SetURL sets the value of URL.
func (s *CreateShortURLReq) SetURL(val string) {
2024-01-29 18:32:16 +00:00
s.URL = val
}
// 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
}
// RedirectLongURLNotFound is response for RedirectLongURL operation.
type RedirectLongURLNotFound struct{}
func (*RedirectLongURLNotFound) redirectLongURLRes() {}
// RedirectLongURLTemporaryRedirect is response for RedirectLongURL operation.
type RedirectLongURLTemporaryRedirect struct {
Location OptString
}
// GetLocation returns the value of Location.
func (s *RedirectLongURLTemporaryRedirect) GetLocation() OptString {
return s.Location
}
// SetLocation sets the value of Location.
func (s *RedirectLongURLTemporaryRedirect) SetLocation(val OptString) {
s.Location = val
}
func (*RedirectLongURLTemporaryRedirect) redirectLongURLRes() {}