github.com/khulnasoft/codebase@v0.0.0-20231214144635-a707781cbb24/go-bitbucket/model_paginated_annotations.go (about)

     1  /*
     2   * Bitbucket API
     3   *
     4   * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
     5   *
     6   * API version: 2.0
     7   * Contact: support@bitbucket.org
     8   */
     9  
    10  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    11  
    12  package bitbucket
    13  
    14  import (
    15  	"encoding/json"
    16  )
    17  
    18  // PaginatedAnnotations A paginated list of annotations.
    19  type PaginatedAnnotations struct {
    20  	// Page number of the current results. This is an optional element that is not provided in all responses.
    21  	Page *int32 `json:"page,omitempty"`
    22  	// The values of the current page.
    23  	Values *[]ReportAnnotation `json:"values,omitempty"`
    24  	// Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
    25  	Size *int32 `json:"size,omitempty"`
    26  	// Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.
    27  	Pagelen *int32 `json:"pagelen,omitempty"`
    28  	// Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.
    29  	Next *string `json:"next,omitempty"`
    30  	// Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.
    31  	Previous *string `json:"previous,omitempty"`
    32  }
    33  
    34  // NewPaginatedAnnotations instantiates a new PaginatedAnnotations object
    35  // This constructor will assign default values to properties that have it defined,
    36  // and makes sure properties required by API are set, but the set of arguments
    37  // will change when the set of required properties is changed
    38  func NewPaginatedAnnotations() *PaginatedAnnotations {
    39  	this := PaginatedAnnotations{}
    40  	return &this
    41  }
    42  
    43  // NewPaginatedAnnotationsWithDefaults instantiates a new PaginatedAnnotations object
    44  // This constructor will only assign default values to properties that have it defined,
    45  // but it doesn't guarantee that properties required by API are set
    46  func NewPaginatedAnnotationsWithDefaults() *PaginatedAnnotations {
    47  	this := PaginatedAnnotations{}
    48  	return &this
    49  }
    50  
    51  // GetPage returns the Page field value if set, zero value otherwise.
    52  func (o *PaginatedAnnotations) GetPage() int32 {
    53  	if o == nil || o.Page == nil {
    54  		var ret int32
    55  		return ret
    56  	}
    57  	return *o.Page
    58  }
    59  
    60  // GetPageOk returns a tuple with the Page field value if set, nil otherwise
    61  // and a boolean to check if the value has been set.
    62  func (o *PaginatedAnnotations) GetPageOk() (*int32, bool) {
    63  	if o == nil || o.Page == nil {
    64  		return nil, false
    65  	}
    66  	return o.Page, true
    67  }
    68  
    69  // HasPage returns a boolean if a field has been set.
    70  func (o *PaginatedAnnotations) HasPage() bool {
    71  	if o != nil && o.Page != nil {
    72  		return true
    73  	}
    74  
    75  	return false
    76  }
    77  
    78  // SetPage gets a reference to the given int32 and assigns it to the Page field.
    79  func (o *PaginatedAnnotations) SetPage(v int32) {
    80  	o.Page = &v
    81  }
    82  
    83  // GetValues returns the Values field value if set, zero value otherwise.
    84  func (o *PaginatedAnnotations) GetValues() []ReportAnnotation {
    85  	if o == nil || o.Values == nil {
    86  		var ret []ReportAnnotation
    87  		return ret
    88  	}
    89  	return *o.Values
    90  }
    91  
    92  // GetValuesOk returns a tuple with the Values field value if set, nil otherwise
    93  // and a boolean to check if the value has been set.
    94  func (o *PaginatedAnnotations) GetValuesOk() (*[]ReportAnnotation, bool) {
    95  	if o == nil || o.Values == nil {
    96  		return nil, false
    97  	}
    98  	return o.Values, true
    99  }
   100  
   101  // HasValues returns a boolean if a field has been set.
   102  func (o *PaginatedAnnotations) HasValues() bool {
   103  	if o != nil && o.Values != nil {
   104  		return true
   105  	}
   106  
   107  	return false
   108  }
   109  
   110  // SetValues gets a reference to the given []ReportAnnotation and assigns it to the Values field.
   111  func (o *PaginatedAnnotations) SetValues(v []ReportAnnotation) {
   112  	o.Values = &v
   113  }
   114  
   115  // GetSize returns the Size field value if set, zero value otherwise.
   116  func (o *PaginatedAnnotations) GetSize() int32 {
   117  	if o == nil || o.Size == nil {
   118  		var ret int32
   119  		return ret
   120  	}
   121  	return *o.Size
   122  }
   123  
   124  // GetSizeOk returns a tuple with the Size field value if set, nil otherwise
   125  // and a boolean to check if the value has been set.
   126  func (o *PaginatedAnnotations) GetSizeOk() (*int32, bool) {
   127  	if o == nil || o.Size == nil {
   128  		return nil, false
   129  	}
   130  	return o.Size, true
   131  }
   132  
   133  // HasSize returns a boolean if a field has been set.
   134  func (o *PaginatedAnnotations) HasSize() bool {
   135  	if o != nil && o.Size != nil {
   136  		return true
   137  	}
   138  
   139  	return false
   140  }
   141  
   142  // SetSize gets a reference to the given int32 and assigns it to the Size field.
   143  func (o *PaginatedAnnotations) SetSize(v int32) {
   144  	o.Size = &v
   145  }
   146  
   147  // GetPagelen returns the Pagelen field value if set, zero value otherwise.
   148  func (o *PaginatedAnnotations) GetPagelen() int32 {
   149  	if o == nil || o.Pagelen == nil {
   150  		var ret int32
   151  		return ret
   152  	}
   153  	return *o.Pagelen
   154  }
   155  
   156  // GetPagelenOk returns a tuple with the Pagelen field value if set, nil otherwise
   157  // and a boolean to check if the value has been set.
   158  func (o *PaginatedAnnotations) GetPagelenOk() (*int32, bool) {
   159  	if o == nil || o.Pagelen == nil {
   160  		return nil, false
   161  	}
   162  	return o.Pagelen, true
   163  }
   164  
   165  // HasPagelen returns a boolean if a field has been set.
   166  func (o *PaginatedAnnotations) HasPagelen() bool {
   167  	if o != nil && o.Pagelen != nil {
   168  		return true
   169  	}
   170  
   171  	return false
   172  }
   173  
   174  // SetPagelen gets a reference to the given int32 and assigns it to the Pagelen field.
   175  func (o *PaginatedAnnotations) SetPagelen(v int32) {
   176  	o.Pagelen = &v
   177  }
   178  
   179  // GetNext returns the Next field value if set, zero value otherwise.
   180  func (o *PaginatedAnnotations) GetNext() string {
   181  	if o == nil || o.Next == nil {
   182  		var ret string
   183  		return ret
   184  	}
   185  	return *o.Next
   186  }
   187  
   188  // GetNextOk returns a tuple with the Next field value if set, nil otherwise
   189  // and a boolean to check if the value has been set.
   190  func (o *PaginatedAnnotations) GetNextOk() (*string, bool) {
   191  	if o == nil || o.Next == nil {
   192  		return nil, false
   193  	}
   194  	return o.Next, true
   195  }
   196  
   197  // HasNext returns a boolean if a field has been set.
   198  func (o *PaginatedAnnotations) HasNext() bool {
   199  	if o != nil && o.Next != nil {
   200  		return true
   201  	}
   202  
   203  	return false
   204  }
   205  
   206  // SetNext gets a reference to the given string and assigns it to the Next field.
   207  func (o *PaginatedAnnotations) SetNext(v string) {
   208  	o.Next = &v
   209  }
   210  
   211  // GetPrevious returns the Previous field value if set, zero value otherwise.
   212  func (o *PaginatedAnnotations) GetPrevious() string {
   213  	if o == nil || o.Previous == nil {
   214  		var ret string
   215  		return ret
   216  	}
   217  	return *o.Previous
   218  }
   219  
   220  // GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise
   221  // and a boolean to check if the value has been set.
   222  func (o *PaginatedAnnotations) GetPreviousOk() (*string, bool) {
   223  	if o == nil || o.Previous == nil {
   224  		return nil, false
   225  	}
   226  	return o.Previous, true
   227  }
   228  
   229  // HasPrevious returns a boolean if a field has been set.
   230  func (o *PaginatedAnnotations) HasPrevious() bool {
   231  	if o != nil && o.Previous != nil {
   232  		return true
   233  	}
   234  
   235  	return false
   236  }
   237  
   238  // SetPrevious gets a reference to the given string and assigns it to the Previous field.
   239  func (o *PaginatedAnnotations) SetPrevious(v string) {
   240  	o.Previous = &v
   241  }
   242  
   243  func (o PaginatedAnnotations) MarshalJSON() ([]byte, error) {
   244  	toSerialize := map[string]interface{}{}
   245  	if o.Page != nil {
   246  		toSerialize["page"] = o.Page
   247  	}
   248  	if o.Values != nil {
   249  		toSerialize["values"] = o.Values
   250  	}
   251  	if o.Size != nil {
   252  		toSerialize["size"] = o.Size
   253  	}
   254  	if o.Pagelen != nil {
   255  		toSerialize["pagelen"] = o.Pagelen
   256  	}
   257  	if o.Next != nil {
   258  		toSerialize["next"] = o.Next
   259  	}
   260  	if o.Previous != nil {
   261  		toSerialize["previous"] = o.Previous
   262  	}
   263  	return json.Marshal(toSerialize)
   264  }
   265  
   266  type NullablePaginatedAnnotations struct {
   267  	value *PaginatedAnnotations
   268  	isSet bool
   269  }
   270  
   271  func (v NullablePaginatedAnnotations) Get() *PaginatedAnnotations {
   272  	return v.value
   273  }
   274  
   275  func (v *NullablePaginatedAnnotations) Set(val *PaginatedAnnotations) {
   276  	v.value = val
   277  	v.isSet = true
   278  }
   279  
   280  func (v NullablePaginatedAnnotations) IsSet() bool {
   281  	return v.isSet
   282  }
   283  
   284  func (v *NullablePaginatedAnnotations) Unset() {
   285  	v.value = nil
   286  	v.isSet = false
   287  }
   288  
   289  func NewNullablePaginatedAnnotations(val *PaginatedAnnotations) *NullablePaginatedAnnotations {
   290  	return &NullablePaginatedAnnotations{value: val, isSet: true}
   291  }
   292  
   293  func (v NullablePaginatedAnnotations) MarshalJSON() ([]byte, error) {
   294  	return json.Marshal(v.value)
   295  }
   296  
   297  func (v *NullablePaginatedAnnotations) UnmarshalJSON(src []byte) error {
   298  	v.isSet = true
   299  	return json.Unmarshal(src, &v.value)
   300  }