Files
sdk/model_author_org_view.go

345 lines
10 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the AuthorOrgView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuthorOrgView{}
// AuthorOrgView struct for AuthorOrgView
type AuthorOrgView struct {
// BadgeMarkdown is the ready-to-paste README snippet, DERIVED for each response from this deployment's badge host and never stored — here it deep-links the OWNER's template import rather than one repository's.
BadgeMarkdown *string `json:"badgeMarkdown,omitempty"`
// CreatedAt is unix seconds when the owner claim was first recorded — equal to verifiedAt on the first proof, then fixed while verifiedAt moves.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Method is HOW the owner was proven, always against its \".github\" control repository: \"oauth\" — an IAM-linked forge token showed admin or push on it; or \"file\" — a hanzo.json on its default branch carried this author's verify code. The \"maintainer\" shortcut is a per-repository attribution and never appears here. Omitted on a row written before the method was recorded.
Method *string `json:"method,omitempty"`
// OwnerURL is the claim key in canonical form — lowercased \"host/owner\" with NO repository segment, host ∈ {github.com, gitlab.com}. It covers every repository under that owner, so code with no claim of its own still earns; a per-repository claim outranks it. UNIQUE across every author: first proven claim wins.
OwnerUrl *string `json:"ownerUrl,omitempty"`
// Verified reports that ownership of the WHOLE owner was proven — against that owner's \".github\" control repository, which is exactly as strong as a per-repository claim. Only a proven claim is written, so every row returned here is true.
Verified *bool `json:"verified,omitempty"`
// VerifiedAt is unix seconds of the most recent successful proof of the owner; re-verifying refreshes it, and the method beside it, in place.
VerifiedAt *int64 `json:"verifiedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AuthorOrgView AuthorOrgView
// NewAuthorOrgView instantiates a new AuthorOrgView 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 NewAuthorOrgView() *AuthorOrgView {
this := AuthorOrgView{}
return &this
}
// NewAuthorOrgViewWithDefaults instantiates a new AuthorOrgView 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 NewAuthorOrgViewWithDefaults() *AuthorOrgView {
this := AuthorOrgView{}
return &this
}
// GetBadgeMarkdown returns the BadgeMarkdown field value if set, zero value otherwise.
func (o *AuthorOrgView) GetBadgeMarkdown() string {
if o == nil || IsNil(o.BadgeMarkdown) {
var ret string
return ret
}
return *o.BadgeMarkdown
}
// GetBadgeMarkdownOk returns a tuple with the BadgeMarkdown field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetBadgeMarkdownOk() (*string, bool) {
if o == nil || IsNil(o.BadgeMarkdown) {
return nil, false
}
return o.BadgeMarkdown, true
}
// HasBadgeMarkdown returns a boolean if a field has been set.
func (o *AuthorOrgView) HasBadgeMarkdown() bool {
if o != nil && !IsNil(o.BadgeMarkdown) {
return true
}
return false
}
// SetBadgeMarkdown gets a reference to the given string and assigns it to the BadgeMarkdown field.
func (o *AuthorOrgView) SetBadgeMarkdown(v string) {
o.BadgeMarkdown = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *AuthorOrgView) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *AuthorOrgView) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *AuthorOrgView) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetMethod returns the Method field value if set, zero value otherwise.
func (o *AuthorOrgView) GetMethod() string {
if o == nil || IsNil(o.Method) {
var ret string
return ret
}
return *o.Method
}
// GetMethodOk returns a tuple with the Method field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetMethodOk() (*string, bool) {
if o == nil || IsNil(o.Method) {
return nil, false
}
return o.Method, true
}
// HasMethod returns a boolean if a field has been set.
func (o *AuthorOrgView) HasMethod() bool {
if o != nil && !IsNil(o.Method) {
return true
}
return false
}
// SetMethod gets a reference to the given string and assigns it to the Method field.
func (o *AuthorOrgView) SetMethod(v string) {
o.Method = &v
}
// GetOwnerUrl returns the OwnerUrl field value if set, zero value otherwise.
func (o *AuthorOrgView) GetOwnerUrl() string {
if o == nil || IsNil(o.OwnerUrl) {
var ret string
return ret
}
return *o.OwnerUrl
}
// GetOwnerUrlOk returns a tuple with the OwnerUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetOwnerUrlOk() (*string, bool) {
if o == nil || IsNil(o.OwnerUrl) {
return nil, false
}
return o.OwnerUrl, true
}
// HasOwnerUrl returns a boolean if a field has been set.
func (o *AuthorOrgView) HasOwnerUrl() bool {
if o != nil && !IsNil(o.OwnerUrl) {
return true
}
return false
}
// SetOwnerUrl gets a reference to the given string and assigns it to the OwnerUrl field.
func (o *AuthorOrgView) SetOwnerUrl(v string) {
o.OwnerUrl = &v
}
// GetVerified returns the Verified field value if set, zero value otherwise.
func (o *AuthorOrgView) GetVerified() bool {
if o == nil || IsNil(o.Verified) {
var ret bool
return ret
}
return *o.Verified
}
// GetVerifiedOk returns a tuple with the Verified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetVerifiedOk() (*bool, bool) {
if o == nil || IsNil(o.Verified) {
return nil, false
}
return o.Verified, true
}
// HasVerified returns a boolean if a field has been set.
func (o *AuthorOrgView) HasVerified() bool {
if o != nil && !IsNil(o.Verified) {
return true
}
return false
}
// SetVerified gets a reference to the given bool and assigns it to the Verified field.
func (o *AuthorOrgView) SetVerified(v bool) {
o.Verified = &v
}
// GetVerifiedAt returns the VerifiedAt field value if set, zero value otherwise.
func (o *AuthorOrgView) GetVerifiedAt() int64 {
if o == nil || IsNil(o.VerifiedAt) {
var ret int64
return ret
}
return *o.VerifiedAt
}
// GetVerifiedAtOk returns a tuple with the VerifiedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorOrgView) GetVerifiedAtOk() (*int64, bool) {
if o == nil || IsNil(o.VerifiedAt) {
return nil, false
}
return o.VerifiedAt, true
}
// HasVerifiedAt returns a boolean if a field has been set.
func (o *AuthorOrgView) HasVerifiedAt() bool {
if o != nil && !IsNil(o.VerifiedAt) {
return true
}
return false
}
// SetVerifiedAt gets a reference to the given int64 and assigns it to the VerifiedAt field.
func (o *AuthorOrgView) SetVerifiedAt(v int64) {
o.VerifiedAt = &v
}
func (o AuthorOrgView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthorOrgView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BadgeMarkdown) {
toSerialize["badgeMarkdown"] = o.BadgeMarkdown
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Method) {
toSerialize["method"] = o.Method
}
if !IsNil(o.OwnerUrl) {
toSerialize["ownerUrl"] = o.OwnerUrl
}
if !IsNil(o.Verified) {
toSerialize["verified"] = o.Verified
}
if !IsNil(o.VerifiedAt) {
toSerialize["verifiedAt"] = o.VerifiedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AuthorOrgView) UnmarshalJSON(data []byte) (err error) {
varAuthorOrgView := _AuthorOrgView{}
err = json.Unmarshal(data, &varAuthorOrgView)
if err != nil {
return err
}
*o = AuthorOrgView(varAuthorOrgView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "badgeMarkdown")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "method")
delete(additionalProperties, "ownerUrl")
delete(additionalProperties, "verified")
delete(additionalProperties, "verifiedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAuthorOrgView struct {
value *AuthorOrgView
isSet bool
}
func (v NullableAuthorOrgView) Get() *AuthorOrgView {
return v.value
}
func (v *NullableAuthorOrgView) Set(val *AuthorOrgView) {
v.value = val
v.isSet = true
}
func (v NullableAuthorOrgView) IsSet() bool {
return v.isSet
}
func (v *NullableAuthorOrgView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthorOrgView(val *AuthorOrgView) *NullableAuthorOrgView {
return &NullableAuthorOrgView{value: val, isSet: true}
}
func (v NullableAuthorOrgView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthorOrgView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}