package msgraph

import "context"

type GovernancePolicyTemplateRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernancePolicyTemplateRequestBuilder) Request() *GovernancePolicyTemplateRequest {
	return &GovernancePolicyTemplateRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernancePolicyTemplateRequest struct{ BaseRequest }

func (r *GovernancePolicyTemplateRequest) Get(ctx context.Context) (resObj *GovernancePolicyTemplate, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernancePolicyTemplateRequest) Update(ctx context.Context, reqObj *GovernancePolicyTemplate) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernancePolicyTemplateRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceResourceRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceResourceRequestBuilder) Request() *GovernanceResourceRequest {
	return &GovernanceResourceRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceResourceRequest struct{ BaseRequest }

func (r *GovernanceResourceRequest) Get(ctx context.Context) (resObj *GovernanceResource, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceResourceRequest) Update(ctx context.Context, reqObj *GovernanceResource) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceResourceRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceRoleAssignmentRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceRoleAssignmentRequestBuilder) Request() *GovernanceRoleAssignmentRequest {
	return &GovernanceRoleAssignmentRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceRoleAssignmentRequest struct{ BaseRequest }

func (r *GovernanceRoleAssignmentRequest) Get(ctx context.Context) (resObj *GovernanceRoleAssignment, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceRoleAssignmentRequest) Update(ctx context.Context, reqObj *GovernanceRoleAssignment) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceRoleAssignmentRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceRoleAssignmentRequestObjectRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceRoleAssignmentRequestObjectRequestBuilder) Request() *GovernanceRoleAssignmentRequestObjectRequest {
	return &GovernanceRoleAssignmentRequestObjectRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceRoleAssignmentRequestObjectRequest struct{ BaseRequest }

func (r *GovernanceRoleAssignmentRequestObjectRequest) Get(ctx context.Context) (resObj *GovernanceRoleAssignmentRequestObject, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceRoleAssignmentRequestObjectRequest) Update(ctx context.Context, reqObj *GovernanceRoleAssignmentRequestObject) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceRoleAssignmentRequestObjectRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceRoleDefinitionRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceRoleDefinitionRequestBuilder) Request() *GovernanceRoleDefinitionRequest {
	return &GovernanceRoleDefinitionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceRoleDefinitionRequest struct{ BaseRequest }

func (r *GovernanceRoleDefinitionRequest) Get(ctx context.Context) (resObj *GovernanceRoleDefinition, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceRoleDefinitionRequest) Update(ctx context.Context, reqObj *GovernanceRoleDefinition) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceRoleDefinitionRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceRoleSettingRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceRoleSettingRequestBuilder) Request() *GovernanceRoleSettingRequest {
	return &GovernanceRoleSettingRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceRoleSettingRequest struct{ BaseRequest }

func (r *GovernanceRoleSettingRequest) Get(ctx context.Context) (resObj *GovernanceRoleSetting, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceRoleSettingRequest) Update(ctx context.Context, reqObj *GovernanceRoleSetting) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceRoleSettingRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceSubjectRequestBuilder struct{ BaseRequestBuilder }

func (b *GovernanceSubjectRequestBuilder) Request() *GovernanceSubjectRequest {
	return &GovernanceSubjectRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

type GovernanceSubjectRequest struct{ BaseRequest }

func (r *GovernanceSubjectRequest) Get(ctx context.Context) (resObj *GovernanceSubject, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

func (r *GovernanceSubjectRequest) Update(ctx context.Context, reqObj *GovernanceSubject) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

func (r *GovernanceSubjectRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

type GovernanceResourceCollectionRegisterRequestBuilder struct{ BaseRequestBuilder }

func (b *PrivilegedAccessResourcesCollectionRequestBuilder) Register(reqObj *GovernanceResourceCollectionRegisterRequestParameter) *GovernanceResourceCollectionRegisterRequestBuilder {
	bb := &GovernanceResourceCollectionRegisterRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.BaseRequestBuilder.baseURL += "/register"
	bb.BaseRequestBuilder.requestObject = reqObj
	return bb
}

type GovernanceResourceCollectionRegisterRequest struct{ BaseRequest }

func (b *GovernanceResourceCollectionRegisterRequestBuilder) Request() *GovernanceResourceCollectionRegisterRequest {
	return &GovernanceResourceCollectionRegisterRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client, requestObject: b.requestObject},
	}
}

func (r *GovernanceResourceCollectionRegisterRequest) Post(ctx context.Context) error {
	return r.JSONRequest(ctx, "POST", "", r.requestObject, nil)
}
// Code generated by msgraph.go/gen DO NOT EDIT.

package msgraph

import "context"

// GovernancePolicyTemplateRequestBuilder is request builder for GovernancePolicyTemplate
type GovernancePolicyTemplateRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernancePolicyTemplateRequest
func (b *GovernancePolicyTemplateRequestBuilder) Request() *GovernancePolicyTemplateRequest {
	return &GovernancePolicyTemplateRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernancePolicyTemplateRequest is request for GovernancePolicyTemplate
type GovernancePolicyTemplateRequest struct{ BaseRequest }

// Get performs GET request for GovernancePolicyTemplate
func (r *GovernancePolicyTemplateRequest) Get(ctx context.Context) (resObj *GovernancePolicyTemplate, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernancePolicyTemplate
func (r *GovernancePolicyTemplateRequest) Update(ctx context.Context, reqObj *GovernancePolicyTemplate) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernancePolicyTemplate
func (r *GovernancePolicyTemplateRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceResourceRequestBuilder is request builder for GovernanceResource
type GovernanceResourceRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceResourceRequest
func (b *GovernanceResourceRequestBuilder) Request() *GovernanceResourceRequest {
	return &GovernanceResourceRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceResourceRequest is request for GovernanceResource
type GovernanceResourceRequest struct{ BaseRequest }

// Get performs GET request for GovernanceResource
func (r *GovernanceResourceRequest) Get(ctx context.Context) (resObj *GovernanceResource, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceResource
func (r *GovernanceResourceRequest) Update(ctx context.Context, reqObj *GovernanceResource) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceResource
func (r *GovernanceResourceRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceRoleAssignmentRequestBuilder is request builder for GovernanceRoleAssignment
type GovernanceRoleAssignmentRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceRoleAssignmentRequest
func (b *GovernanceRoleAssignmentRequestBuilder) Request() *GovernanceRoleAssignmentRequest {
	return &GovernanceRoleAssignmentRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceRoleAssignmentRequest is request for GovernanceRoleAssignment
type GovernanceRoleAssignmentRequest struct{ BaseRequest }

// Get performs GET request for GovernanceRoleAssignment
func (r *GovernanceRoleAssignmentRequest) Get(ctx context.Context) (resObj *GovernanceRoleAssignment, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceRoleAssignment
func (r *GovernanceRoleAssignmentRequest) Update(ctx context.Context, reqObj *GovernanceRoleAssignment) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceRoleAssignment
func (r *GovernanceRoleAssignmentRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceRoleAssignmentRequestObjectRequestBuilder is request builder for GovernanceRoleAssignmentRequestObject
type GovernanceRoleAssignmentRequestObjectRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceRoleAssignmentRequestObjectRequest
func (b *GovernanceRoleAssignmentRequestObjectRequestBuilder) Request() *GovernanceRoleAssignmentRequestObjectRequest {
	return &GovernanceRoleAssignmentRequestObjectRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceRoleAssignmentRequestObjectRequest is request for GovernanceRoleAssignmentRequestObject
type GovernanceRoleAssignmentRequestObjectRequest struct{ BaseRequest }

// Get performs GET request for GovernanceRoleAssignmentRequestObject
func (r *GovernanceRoleAssignmentRequestObjectRequest) Get(ctx context.Context) (resObj *GovernanceRoleAssignmentRequestObject, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceRoleAssignmentRequestObject
func (r *GovernanceRoleAssignmentRequestObjectRequest) Update(ctx context.Context, reqObj *GovernanceRoleAssignmentRequestObject) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceRoleAssignmentRequestObject
func (r *GovernanceRoleAssignmentRequestObjectRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceRoleDefinitionRequestBuilder is request builder for GovernanceRoleDefinition
type GovernanceRoleDefinitionRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceRoleDefinitionRequest
func (b *GovernanceRoleDefinitionRequestBuilder) Request() *GovernanceRoleDefinitionRequest {
	return &GovernanceRoleDefinitionRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceRoleDefinitionRequest is request for GovernanceRoleDefinition
type GovernanceRoleDefinitionRequest struct{ BaseRequest }

// Get performs GET request for GovernanceRoleDefinition
func (r *GovernanceRoleDefinitionRequest) Get(ctx context.Context) (resObj *GovernanceRoleDefinition, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceRoleDefinition
func (r *GovernanceRoleDefinitionRequest) Update(ctx context.Context, reqObj *GovernanceRoleDefinition) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceRoleDefinition
func (r *GovernanceRoleDefinitionRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceRoleSettingRequestBuilder is request builder for GovernanceRoleSetting
type GovernanceRoleSettingRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceRoleSettingRequest
func (b *GovernanceRoleSettingRequestBuilder) Request() *GovernanceRoleSettingRequest {
	return &GovernanceRoleSettingRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceRoleSettingRequest is request for GovernanceRoleSetting
type GovernanceRoleSettingRequest struct{ BaseRequest }

// Get performs GET request for GovernanceRoleSetting
func (r *GovernanceRoleSettingRequest) Get(ctx context.Context) (resObj *GovernanceRoleSetting, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceRoleSetting
func (r *GovernanceRoleSettingRequest) Update(ctx context.Context, reqObj *GovernanceRoleSetting) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceRoleSetting
func (r *GovernanceRoleSettingRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

// GovernanceSubjectRequestBuilder is request builder for GovernanceSubject
type GovernanceSubjectRequestBuilder struct{ BaseRequestBuilder }

// Request returns GovernanceSubjectRequest
func (b *GovernanceSubjectRequestBuilder) Request() *GovernanceSubjectRequest {
	return &GovernanceSubjectRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
	}
}

// GovernanceSubjectRequest is request for GovernanceSubject
type GovernanceSubjectRequest struct{ BaseRequest }

// Get performs GET request for GovernanceSubject
func (r *GovernanceSubjectRequest) Get(ctx context.Context) (resObj *GovernanceSubject, err error) {
	var query string
	if r.query != nil {
		query = "?" + r.query.Encode()
	}
	err = r.JSONRequest(ctx, "GET", query, nil, &resObj)
	return
}

// Update performs PATCH request for GovernanceSubject
func (r *GovernanceSubjectRequest) Update(ctx context.Context, reqObj *GovernanceSubject) error {
	return r.JSONRequest(ctx, "PATCH", "", reqObj, nil)
}

// Delete performs DELETE request for GovernanceSubject
func (r *GovernanceSubjectRequest) Delete(ctx context.Context) error {
	return r.JSONRequest(ctx, "DELETE", "", nil, nil)
}

//
type GovernanceResourceCollectionRegisterRequestBuilder struct{ BaseRequestBuilder }

// Register action undocumented
func (b *PrivilegedAccessResourcesCollectionRequestBuilder) Register(reqObj *GovernanceResourceCollectionRegisterRequestParameter) *GovernanceResourceCollectionRegisterRequestBuilder {
	bb := &GovernanceResourceCollectionRegisterRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
	bb.BaseRequestBuilder.baseURL += "/register"
	bb.BaseRequestBuilder.requestObject = reqObj
	return bb
}

//
type GovernanceResourceCollectionRegisterRequest struct{ BaseRequest }

//
func (b *GovernanceResourceCollectionRegisterRequestBuilder) Request() *GovernanceResourceCollectionRegisterRequest {
	return &GovernanceResourceCollectionRegisterRequest{
		BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client, requestObject: b.requestObject},
	}
}

//
func (r *GovernanceResourceCollectionRegisterRequest) Post(ctx context.Context) error {
	return r.JSONRequest(ctx, "POST", "", r.requestObject, nil)
}
