github.com/yaegashi/msgraph.go@v0.1.4/beta/RequestExtension.go (about)

     1  // Code generated by msgraph.go/gen DO NOT EDIT.
     2  
     3  package msgraph
     4  
     5  import "context"
     6  
     7  // ExtensionRequestBuilder is request builder for Extension
     8  type ExtensionRequestBuilder struct{ BaseRequestBuilder }
     9  
    10  // Request returns ExtensionRequest
    11  func (b *ExtensionRequestBuilder) Request() *ExtensionRequest {
    12  	return &ExtensionRequest{
    13  		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
    14  	}
    15  }
    16  
    17  // ExtensionRequest is request for Extension
    18  type ExtensionRequest struct{ BaseRequest }
    19  
    20  // Get performs GET request for Extension
    21  func (r *ExtensionRequest) Get(ctx context.Context) (resObj *Extension, err error) {
    22  	var query string
    23  	if r.query != nil {
    24  		query = "?" + r.query.Encode()
    25  	}
    26  	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
    27  	return
    28  }
    29  
    30  // Update performs PATCH request for Extension
    31  func (r *ExtensionRequest) Update(ctx context.Context, reqObj *Extension) error {
    32  	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
    33  }
    34  
    35  // Delete performs DELETE request for Extension
    36  func (r *ExtensionRequest) Delete(ctx context.Context) error {
    37  	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
    38  }
    39  
    40  // ExtensionPropertyRequestBuilder is request builder for ExtensionProperty
    41  type ExtensionPropertyRequestBuilder struct{ BaseRequestBuilder }
    42  
    43  // Request returns ExtensionPropertyRequest
    44  func (b *ExtensionPropertyRequestBuilder) Request() *ExtensionPropertyRequest {
    45  	return &ExtensionPropertyRequest{
    46  		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
    47  	}
    48  }
    49  
    50  // ExtensionPropertyRequest is request for ExtensionProperty
    51  type ExtensionPropertyRequest struct{ BaseRequest }
    52  
    53  // Get performs GET request for ExtensionProperty
    54  func (r *ExtensionPropertyRequest) Get(ctx context.Context) (resObj *ExtensionProperty, err error) {
    55  	var query string
    56  	if r.query != nil {
    57  		query = "?" + r.query.Encode()
    58  	}
    59  	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
    60  	return
    61  }
    62  
    63  // Update performs PATCH request for ExtensionProperty
    64  func (r *ExtensionPropertyRequest) Update(ctx context.Context, reqObj *ExtensionProperty) error {
    65  	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
    66  }
    67  
    68  // Delete performs DELETE request for ExtensionProperty
    69  func (r *ExtensionPropertyRequest) Delete(ctx context.Context) error {
    70  	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
    71  }