github.com/openshift-online/ocm-sdk-go@v0.1.473/clustersmgmt/v1/kubelet_config_client.go (about)

     1  /*
     2  Copyright (c) 2020 Red Hat, Inc.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8    http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
    18  // your changes will be lost when the file is generated again.
    19  
    20  package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
    21  
    22  import (
    23  	"bufio"
    24  	"bytes"
    25  	"context"
    26  	"io"
    27  	"net/http"
    28  	"net/url"
    29  	"time"
    30  
    31  	"github.com/openshift-online/ocm-sdk-go/errors"
    32  	"github.com/openshift-online/ocm-sdk-go/helpers"
    33  )
    34  
    35  // KubeletConfigClient is the client of the 'kubelet_config' resource.
    36  //
    37  // Manages global KubeletConfig configuration for worker nodes in a cluster.
    38  type KubeletConfigClient struct {
    39  	transport http.RoundTripper
    40  	path      string
    41  }
    42  
    43  // NewKubeletConfigClient creates a new client for the 'kubelet_config'
    44  // resource using the given transport to send the requests and receive the
    45  // responses.
    46  func NewKubeletConfigClient(transport http.RoundTripper, path string) *KubeletConfigClient {
    47  	return &KubeletConfigClient{
    48  		transport: transport,
    49  		path:      path,
    50  	}
    51  }
    52  
    53  // Delete creates a request for the 'delete' method.
    54  //
    55  // Deletes the cluster KubeletConfig
    56  func (c *KubeletConfigClient) Delete() *KubeletConfigDeleteRequest {
    57  	return &KubeletConfigDeleteRequest{
    58  		transport: c.transport,
    59  		path:      c.path,
    60  	}
    61  }
    62  
    63  // Get creates a request for the 'get' method.
    64  //
    65  // Retrieves the KubeletConfig for a cluster
    66  func (c *KubeletConfigClient) Get() *KubeletConfigGetRequest {
    67  	return &KubeletConfigGetRequest{
    68  		transport: c.transport,
    69  		path:      c.path,
    70  	}
    71  }
    72  
    73  // Post creates a request for the 'post' method.
    74  //
    75  // Creates a new cluster KubeletConfig
    76  func (c *KubeletConfigClient) Post() *KubeletConfigPostRequest {
    77  	return &KubeletConfigPostRequest{
    78  		transport: c.transport,
    79  		path:      c.path,
    80  	}
    81  }
    82  
    83  // Update creates a request for the 'update' method.
    84  //
    85  // Updates the existing cluster KubeletConfig
    86  func (c *KubeletConfigClient) Update() *KubeletConfigUpdateRequest {
    87  	return &KubeletConfigUpdateRequest{
    88  		transport: c.transport,
    89  		path:      c.path,
    90  	}
    91  }
    92  
    93  // KubeletConfigPollRequest is the request for the Poll method.
    94  type KubeletConfigPollRequest struct {
    95  	request    *KubeletConfigGetRequest
    96  	interval   time.Duration
    97  	statuses   []int
    98  	predicates []func(interface{}) bool
    99  }
   100  
   101  // Parameter adds a query parameter to all the requests that will be used to retrieve the object.
   102  func (r *KubeletConfigPollRequest) Parameter(name string, value interface{}) *KubeletConfigPollRequest {
   103  	r.request.Parameter(name, value)
   104  	return r
   105  }
   106  
   107  // Header adds a request header to all the requests that will be used to retrieve the object.
   108  func (r *KubeletConfigPollRequest) Header(name string, value interface{}) *KubeletConfigPollRequest {
   109  	r.request.Header(name, value)
   110  	return r
   111  }
   112  
   113  // Interval sets the polling interval. This parameter is mandatory and must be greater than zero.
   114  func (r *KubeletConfigPollRequest) Interval(value time.Duration) *KubeletConfigPollRequest {
   115  	r.interval = value
   116  	return r
   117  }
   118  
   119  // Status set the expected status of the response. Multiple values can be set calling this method
   120  // multiple times. The response will be considered successful if the status is any of those values.
   121  func (r *KubeletConfigPollRequest) Status(value int) *KubeletConfigPollRequest {
   122  	r.statuses = append(r.statuses, value)
   123  	return r
   124  }
   125  
   126  // Predicate adds a predicate that the response should satisfy be considered successful. Multiple
   127  // predicates can be set calling this method multiple times. The response will be considered successful
   128  // if all the predicates are satisfied.
   129  func (r *KubeletConfigPollRequest) Predicate(value func(*KubeletConfigGetResponse) bool) *KubeletConfigPollRequest {
   130  	r.predicates = append(r.predicates, func(response interface{}) bool {
   131  		return value(response.(*KubeletConfigGetResponse))
   132  	})
   133  	return r
   134  }
   135  
   136  // StartContext starts the polling loop. Responses will be considered successful if the status is one of
   137  // the values specified with the Status method and if all the predicates specified with the Predicate
   138  // method return nil.
   139  //
   140  // The context must have a timeout or deadline, otherwise this method will immediately return an error.
   141  func (r *KubeletConfigPollRequest) StartContext(ctx context.Context) (response *KubeletConfigPollResponse, err error) {
   142  	result, err := helpers.PollContext(ctx, r.interval, r.statuses, r.predicates, r.task)
   143  	if result != nil {
   144  		response = &KubeletConfigPollResponse{
   145  			response: result.(*KubeletConfigGetResponse),
   146  		}
   147  	}
   148  	return
   149  }
   150  
   151  // task adapts the types of the request/response types so that they can be used with the generic
   152  // polling function from the helpers package.
   153  func (r *KubeletConfigPollRequest) task(ctx context.Context) (status int, result interface{}, err error) {
   154  	response, err := r.request.SendContext(ctx)
   155  	if response != nil {
   156  		status = response.Status()
   157  		result = response
   158  	}
   159  	return
   160  }
   161  
   162  // KubeletConfigPollResponse is the response for the Poll method.
   163  type KubeletConfigPollResponse struct {
   164  	response *KubeletConfigGetResponse
   165  }
   166  
   167  // Status returns the response status code.
   168  func (r *KubeletConfigPollResponse) Status() int {
   169  	if r == nil {
   170  		return 0
   171  	}
   172  	return r.response.Status()
   173  }
   174  
   175  // Header returns header of the response.
   176  func (r *KubeletConfigPollResponse) Header() http.Header {
   177  	if r == nil {
   178  		return nil
   179  	}
   180  	return r.response.Header()
   181  }
   182  
   183  // Error returns the response error.
   184  func (r *KubeletConfigPollResponse) Error() *errors.Error {
   185  	if r == nil {
   186  		return nil
   187  	}
   188  	return r.response.Error()
   189  }
   190  
   191  // Body returns the value of the 'body' parameter.
   192  func (r *KubeletConfigPollResponse) Body() *KubeletConfig {
   193  	return r.response.Body()
   194  }
   195  
   196  // GetBody returns the value of the 'body' parameter and
   197  // a flag indicating if the parameter has a value.
   198  func (r *KubeletConfigPollResponse) GetBody() (value *KubeletConfig, ok bool) {
   199  	return r.response.GetBody()
   200  }
   201  
   202  // Poll creates a request to repeatedly retrieve the object till the response has one of a given set
   203  // of states and satisfies a set of predicates.
   204  func (c *KubeletConfigClient) Poll() *KubeletConfigPollRequest {
   205  	return &KubeletConfigPollRequest{
   206  		request: c.Get(),
   207  	}
   208  }
   209  
   210  // KubeletConfigDeleteRequest is the request for the 'delete' method.
   211  type KubeletConfigDeleteRequest struct {
   212  	transport http.RoundTripper
   213  	path      string
   214  	query     url.Values
   215  	header    http.Header
   216  }
   217  
   218  // Parameter adds a query parameter.
   219  func (r *KubeletConfigDeleteRequest) Parameter(name string, value interface{}) *KubeletConfigDeleteRequest {
   220  	helpers.AddValue(&r.query, name, value)
   221  	return r
   222  }
   223  
   224  // Header adds a request header.
   225  func (r *KubeletConfigDeleteRequest) Header(name string, value interface{}) *KubeletConfigDeleteRequest {
   226  	helpers.AddHeader(&r.header, name, value)
   227  	return r
   228  }
   229  
   230  // Impersonate wraps requests on behalf of another user.
   231  // Note: Services that do not support this feature may silently ignore this call.
   232  func (r *KubeletConfigDeleteRequest) Impersonate(user string) *KubeletConfigDeleteRequest {
   233  	helpers.AddImpersonationHeader(&r.header, user)
   234  	return r
   235  }
   236  
   237  // Send sends this request, waits for the response, and returns it.
   238  //
   239  // This is a potentially lengthy operation, as it requires network communication.
   240  // Consider using a context and the SendContext method.
   241  func (r *KubeletConfigDeleteRequest) Send() (result *KubeletConfigDeleteResponse, err error) {
   242  	return r.SendContext(context.Background())
   243  }
   244  
   245  // SendContext sends this request, waits for the response, and returns it.
   246  func (r *KubeletConfigDeleteRequest) SendContext(ctx context.Context) (result *KubeletConfigDeleteResponse, err error) {
   247  	query := helpers.CopyQuery(r.query)
   248  	header := helpers.CopyHeader(r.header)
   249  	uri := &url.URL{
   250  		Path:     r.path,
   251  		RawQuery: query.Encode(),
   252  	}
   253  	request := &http.Request{
   254  		Method: "DELETE",
   255  		URL:    uri,
   256  		Header: header,
   257  	}
   258  	if ctx != nil {
   259  		request = request.WithContext(ctx)
   260  	}
   261  	response, err := r.transport.RoundTrip(request)
   262  	if err != nil {
   263  		return
   264  	}
   265  	defer response.Body.Close()
   266  	result = &KubeletConfigDeleteResponse{}
   267  	result.status = response.StatusCode
   268  	result.header = response.Header
   269  	reader := bufio.NewReader(response.Body)
   270  	_, err = reader.Peek(1)
   271  	if err == io.EOF {
   272  		err = nil
   273  		return
   274  	}
   275  	if result.status >= 400 {
   276  		result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
   277  		if err != nil {
   278  			return
   279  		}
   280  		err = result.err
   281  		return
   282  	}
   283  	return
   284  }
   285  
   286  // KubeletConfigDeleteResponse is the response for the 'delete' method.
   287  type KubeletConfigDeleteResponse struct {
   288  	status int
   289  	header http.Header
   290  	err    *errors.Error
   291  }
   292  
   293  // Status returns the response status code.
   294  func (r *KubeletConfigDeleteResponse) Status() int {
   295  	if r == nil {
   296  		return 0
   297  	}
   298  	return r.status
   299  }
   300  
   301  // Header returns header of the response.
   302  func (r *KubeletConfigDeleteResponse) Header() http.Header {
   303  	if r == nil {
   304  		return nil
   305  	}
   306  	return r.header
   307  }
   308  
   309  // Error returns the response error.
   310  func (r *KubeletConfigDeleteResponse) Error() *errors.Error {
   311  	if r == nil {
   312  		return nil
   313  	}
   314  	return r.err
   315  }
   316  
   317  // KubeletConfigGetRequest is the request for the 'get' method.
   318  type KubeletConfigGetRequest struct {
   319  	transport http.RoundTripper
   320  	path      string
   321  	query     url.Values
   322  	header    http.Header
   323  }
   324  
   325  // Parameter adds a query parameter.
   326  func (r *KubeletConfigGetRequest) Parameter(name string, value interface{}) *KubeletConfigGetRequest {
   327  	helpers.AddValue(&r.query, name, value)
   328  	return r
   329  }
   330  
   331  // Header adds a request header.
   332  func (r *KubeletConfigGetRequest) Header(name string, value interface{}) *KubeletConfigGetRequest {
   333  	helpers.AddHeader(&r.header, name, value)
   334  	return r
   335  }
   336  
   337  // Impersonate wraps requests on behalf of another user.
   338  // Note: Services that do not support this feature may silently ignore this call.
   339  func (r *KubeletConfigGetRequest) Impersonate(user string) *KubeletConfigGetRequest {
   340  	helpers.AddImpersonationHeader(&r.header, user)
   341  	return r
   342  }
   343  
   344  // Send sends this request, waits for the response, and returns it.
   345  //
   346  // This is a potentially lengthy operation, as it requires network communication.
   347  // Consider using a context and the SendContext method.
   348  func (r *KubeletConfigGetRequest) Send() (result *KubeletConfigGetResponse, err error) {
   349  	return r.SendContext(context.Background())
   350  }
   351  
   352  // SendContext sends this request, waits for the response, and returns it.
   353  func (r *KubeletConfigGetRequest) SendContext(ctx context.Context) (result *KubeletConfigGetResponse, err error) {
   354  	query := helpers.CopyQuery(r.query)
   355  	header := helpers.CopyHeader(r.header)
   356  	uri := &url.URL{
   357  		Path:     r.path,
   358  		RawQuery: query.Encode(),
   359  	}
   360  	request := &http.Request{
   361  		Method: "GET",
   362  		URL:    uri,
   363  		Header: header,
   364  	}
   365  	if ctx != nil {
   366  		request = request.WithContext(ctx)
   367  	}
   368  	response, err := r.transport.RoundTrip(request)
   369  	if err != nil {
   370  		return
   371  	}
   372  	defer response.Body.Close()
   373  	result = &KubeletConfigGetResponse{}
   374  	result.status = response.StatusCode
   375  	result.header = response.Header
   376  	reader := bufio.NewReader(response.Body)
   377  	_, err = reader.Peek(1)
   378  	if err == io.EOF {
   379  		err = nil
   380  		return
   381  	}
   382  	if result.status >= 400 {
   383  		result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
   384  		if err != nil {
   385  			return
   386  		}
   387  		err = result.err
   388  		return
   389  	}
   390  	err = readKubeletConfigGetResponse(result, reader)
   391  	if err != nil {
   392  		return
   393  	}
   394  	return
   395  }
   396  
   397  // KubeletConfigGetResponse is the response for the 'get' method.
   398  type KubeletConfigGetResponse struct {
   399  	status int
   400  	header http.Header
   401  	err    *errors.Error
   402  	body   *KubeletConfig
   403  }
   404  
   405  // Status returns the response status code.
   406  func (r *KubeletConfigGetResponse) Status() int {
   407  	if r == nil {
   408  		return 0
   409  	}
   410  	return r.status
   411  }
   412  
   413  // Header returns header of the response.
   414  func (r *KubeletConfigGetResponse) Header() http.Header {
   415  	if r == nil {
   416  		return nil
   417  	}
   418  	return r.header
   419  }
   420  
   421  // Error returns the response error.
   422  func (r *KubeletConfigGetResponse) Error() *errors.Error {
   423  	if r == nil {
   424  		return nil
   425  	}
   426  	return r.err
   427  }
   428  
   429  // Body returns the value of the 'body' parameter.
   430  func (r *KubeletConfigGetResponse) Body() *KubeletConfig {
   431  	if r == nil {
   432  		return nil
   433  	}
   434  	return r.body
   435  }
   436  
   437  // GetBody returns the value of the 'body' parameter and
   438  // a flag indicating if the parameter has a value.
   439  func (r *KubeletConfigGetResponse) GetBody() (value *KubeletConfig, ok bool) {
   440  	ok = r != nil && r.body != nil
   441  	if ok {
   442  		value = r.body
   443  	}
   444  	return
   445  }
   446  
   447  // KubeletConfigPostRequest is the request for the 'post' method.
   448  type KubeletConfigPostRequest struct {
   449  	transport http.RoundTripper
   450  	path      string
   451  	query     url.Values
   452  	header    http.Header
   453  	body      *KubeletConfig
   454  }
   455  
   456  // Parameter adds a query parameter.
   457  func (r *KubeletConfigPostRequest) Parameter(name string, value interface{}) *KubeletConfigPostRequest {
   458  	helpers.AddValue(&r.query, name, value)
   459  	return r
   460  }
   461  
   462  // Header adds a request header.
   463  func (r *KubeletConfigPostRequest) Header(name string, value interface{}) *KubeletConfigPostRequest {
   464  	helpers.AddHeader(&r.header, name, value)
   465  	return r
   466  }
   467  
   468  // Impersonate wraps requests on behalf of another user.
   469  // Note: Services that do not support this feature may silently ignore this call.
   470  func (r *KubeletConfigPostRequest) Impersonate(user string) *KubeletConfigPostRequest {
   471  	helpers.AddImpersonationHeader(&r.header, user)
   472  	return r
   473  }
   474  
   475  // Body sets the value of the 'body' parameter.
   476  func (r *KubeletConfigPostRequest) Body(value *KubeletConfig) *KubeletConfigPostRequest {
   477  	r.body = value
   478  	return r
   479  }
   480  
   481  // Send sends this request, waits for the response, and returns it.
   482  //
   483  // This is a potentially lengthy operation, as it requires network communication.
   484  // Consider using a context and the SendContext method.
   485  func (r *KubeletConfigPostRequest) Send() (result *KubeletConfigPostResponse, err error) {
   486  	return r.SendContext(context.Background())
   487  }
   488  
   489  // SendContext sends this request, waits for the response, and returns it.
   490  func (r *KubeletConfigPostRequest) SendContext(ctx context.Context) (result *KubeletConfigPostResponse, err error) {
   491  	query := helpers.CopyQuery(r.query)
   492  	header := helpers.CopyHeader(r.header)
   493  	buffer := &bytes.Buffer{}
   494  	err = writeKubeletConfigPostRequest(r, buffer)
   495  	if err != nil {
   496  		return
   497  	}
   498  	uri := &url.URL{
   499  		Path:     r.path,
   500  		RawQuery: query.Encode(),
   501  	}
   502  	request := &http.Request{
   503  		Method: "POST",
   504  		URL:    uri,
   505  		Header: header,
   506  		Body:   io.NopCloser(buffer),
   507  	}
   508  	if ctx != nil {
   509  		request = request.WithContext(ctx)
   510  	}
   511  	response, err := r.transport.RoundTrip(request)
   512  	if err != nil {
   513  		return
   514  	}
   515  	defer response.Body.Close()
   516  	result = &KubeletConfigPostResponse{}
   517  	result.status = response.StatusCode
   518  	result.header = response.Header
   519  	reader := bufio.NewReader(response.Body)
   520  	_, err = reader.Peek(1)
   521  	if err == io.EOF {
   522  		err = nil
   523  		return
   524  	}
   525  	if result.status >= 400 {
   526  		result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
   527  		if err != nil {
   528  			return
   529  		}
   530  		err = result.err
   531  		return
   532  	}
   533  	err = readKubeletConfigPostResponse(result, reader)
   534  	if err != nil {
   535  		return
   536  	}
   537  	return
   538  }
   539  
   540  // KubeletConfigPostResponse is the response for the 'post' method.
   541  type KubeletConfigPostResponse struct {
   542  	status int
   543  	header http.Header
   544  	err    *errors.Error
   545  	body   *KubeletConfig
   546  }
   547  
   548  // Status returns the response status code.
   549  func (r *KubeletConfigPostResponse) Status() int {
   550  	if r == nil {
   551  		return 0
   552  	}
   553  	return r.status
   554  }
   555  
   556  // Header returns header of the response.
   557  func (r *KubeletConfigPostResponse) Header() http.Header {
   558  	if r == nil {
   559  		return nil
   560  	}
   561  	return r.header
   562  }
   563  
   564  // Error returns the response error.
   565  func (r *KubeletConfigPostResponse) Error() *errors.Error {
   566  	if r == nil {
   567  		return nil
   568  	}
   569  	return r.err
   570  }
   571  
   572  // Body returns the value of the 'body' parameter.
   573  func (r *KubeletConfigPostResponse) Body() *KubeletConfig {
   574  	if r == nil {
   575  		return nil
   576  	}
   577  	return r.body
   578  }
   579  
   580  // GetBody returns the value of the 'body' parameter and
   581  // a flag indicating if the parameter has a value.
   582  func (r *KubeletConfigPostResponse) GetBody() (value *KubeletConfig, ok bool) {
   583  	ok = r != nil && r.body != nil
   584  	if ok {
   585  		value = r.body
   586  	}
   587  	return
   588  }
   589  
   590  // KubeletConfigUpdateRequest is the request for the 'update' method.
   591  type KubeletConfigUpdateRequest struct {
   592  	transport http.RoundTripper
   593  	path      string
   594  	query     url.Values
   595  	header    http.Header
   596  	body      *KubeletConfig
   597  }
   598  
   599  // Parameter adds a query parameter.
   600  func (r *KubeletConfigUpdateRequest) Parameter(name string, value interface{}) *KubeletConfigUpdateRequest {
   601  	helpers.AddValue(&r.query, name, value)
   602  	return r
   603  }
   604  
   605  // Header adds a request header.
   606  func (r *KubeletConfigUpdateRequest) Header(name string, value interface{}) *KubeletConfigUpdateRequest {
   607  	helpers.AddHeader(&r.header, name, value)
   608  	return r
   609  }
   610  
   611  // Impersonate wraps requests on behalf of another user.
   612  // Note: Services that do not support this feature may silently ignore this call.
   613  func (r *KubeletConfigUpdateRequest) Impersonate(user string) *KubeletConfigUpdateRequest {
   614  	helpers.AddImpersonationHeader(&r.header, user)
   615  	return r
   616  }
   617  
   618  // Body sets the value of the 'body' parameter.
   619  func (r *KubeletConfigUpdateRequest) Body(value *KubeletConfig) *KubeletConfigUpdateRequest {
   620  	r.body = value
   621  	return r
   622  }
   623  
   624  // Send sends this request, waits for the response, and returns it.
   625  //
   626  // This is a potentially lengthy operation, as it requires network communication.
   627  // Consider using a context and the SendContext method.
   628  func (r *KubeletConfigUpdateRequest) Send() (result *KubeletConfigUpdateResponse, err error) {
   629  	return r.SendContext(context.Background())
   630  }
   631  
   632  // SendContext sends this request, waits for the response, and returns it.
   633  func (r *KubeletConfigUpdateRequest) SendContext(ctx context.Context) (result *KubeletConfigUpdateResponse, err error) {
   634  	query := helpers.CopyQuery(r.query)
   635  	header := helpers.CopyHeader(r.header)
   636  	buffer := &bytes.Buffer{}
   637  	err = writeKubeletConfigUpdateRequest(r, buffer)
   638  	if err != nil {
   639  		return
   640  	}
   641  	uri := &url.URL{
   642  		Path:     r.path,
   643  		RawQuery: query.Encode(),
   644  	}
   645  	request := &http.Request{
   646  		Method: "PATCH",
   647  		URL:    uri,
   648  		Header: header,
   649  		Body:   io.NopCloser(buffer),
   650  	}
   651  	if ctx != nil {
   652  		request = request.WithContext(ctx)
   653  	}
   654  	response, err := r.transport.RoundTrip(request)
   655  	if err != nil {
   656  		return
   657  	}
   658  	defer response.Body.Close()
   659  	result = &KubeletConfigUpdateResponse{}
   660  	result.status = response.StatusCode
   661  	result.header = response.Header
   662  	reader := bufio.NewReader(response.Body)
   663  	_, err = reader.Peek(1)
   664  	if err == io.EOF {
   665  		err = nil
   666  		return
   667  	}
   668  	if result.status >= 400 {
   669  		result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
   670  		if err != nil {
   671  			return
   672  		}
   673  		err = result.err
   674  		return
   675  	}
   676  	err = readKubeletConfigUpdateResponse(result, reader)
   677  	if err != nil {
   678  		return
   679  	}
   680  	return
   681  }
   682  
   683  // KubeletConfigUpdateResponse is the response for the 'update' method.
   684  type KubeletConfigUpdateResponse struct {
   685  	status int
   686  	header http.Header
   687  	err    *errors.Error
   688  	body   *KubeletConfig
   689  }
   690  
   691  // Status returns the response status code.
   692  func (r *KubeletConfigUpdateResponse) Status() int {
   693  	if r == nil {
   694  		return 0
   695  	}
   696  	return r.status
   697  }
   698  
   699  // Header returns header of the response.
   700  func (r *KubeletConfigUpdateResponse) Header() http.Header {
   701  	if r == nil {
   702  		return nil
   703  	}
   704  	return r.header
   705  }
   706  
   707  // Error returns the response error.
   708  func (r *KubeletConfigUpdateResponse) Error() *errors.Error {
   709  	if r == nil {
   710  		return nil
   711  	}
   712  	return r.err
   713  }
   714  
   715  // Body returns the value of the 'body' parameter.
   716  func (r *KubeletConfigUpdateResponse) Body() *KubeletConfig {
   717  	if r == nil {
   718  		return nil
   719  	}
   720  	return r.body
   721  }
   722  
   723  // GetBody returns the value of the 'body' parameter and
   724  // a flag indicating if the parameter has a value.
   725  func (r *KubeletConfigUpdateResponse) GetBody() (value *KubeletConfig, ok bool) {
   726  	ok = r != nil && r.body != nil
   727  	if ok {
   728  		value = r.body
   729  	}
   730  	return
   731  }