mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
147 lines
8.2 KiB
Go
147 lines
8.2 KiB
Go
package external
|
|
|
|
import (
|
|
"context"
|
|
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
|
|
i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc "github.com/microsoftgraph/msgraph-sdk-go/models/externalconnectors"
|
|
ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
|
|
)
|
|
|
|
// ExternalRequestBuilder provides operations to manage the external singleton.
|
|
type ExternalRequestBuilder struct {
|
|
// Path parameters for the request
|
|
pathParameters map[string]string
|
|
// The request adapter to use to execute the requests.
|
|
requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter
|
|
// Url template to use to build the URL for the current request builder
|
|
urlTemplate string
|
|
}
|
|
// ExternalRequestBuilderGetQueryParameters get external
|
|
type ExternalRequestBuilderGetQueryParameters struct {
|
|
// Expand related entities
|
|
Expand []string `uriparametername:"%24expand"`
|
|
// Select properties to be returned
|
|
Select []string `uriparametername:"%24select"`
|
|
}
|
|
// ExternalRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
|
|
type ExternalRequestBuilderGetRequestConfiguration struct {
|
|
// Request headers
|
|
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
|
|
// Request options
|
|
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
|
|
// Request query parameters
|
|
QueryParameters *ExternalRequestBuilderGetQueryParameters
|
|
}
|
|
// ExternalRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
|
|
type ExternalRequestBuilderPatchRequestConfiguration struct {
|
|
// Request headers
|
|
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
|
|
// Request options
|
|
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
|
|
}
|
|
// Connections provides operations to manage the connections property of the microsoft.graph.externalConnectors.external entity.
|
|
func (m *ExternalRequestBuilder) Connections()(*ConnectionsRequestBuilder) {
|
|
return NewConnectionsRequestBuilderInternal(m.pathParameters, m.requestAdapter)
|
|
}
|
|
// ConnectionsById provides operations to manage the connections property of the microsoft.graph.externalConnectors.external entity.
|
|
func (m *ExternalRequestBuilder) ConnectionsById(id string)(*ConnectionsExternalConnectionItemRequestBuilder) {
|
|
urlTplParams := make(map[string]string)
|
|
for idx, item := range m.pathParameters {
|
|
urlTplParams[idx] = item
|
|
}
|
|
if id != "" {
|
|
urlTplParams["externalConnection%2Did"] = id
|
|
}
|
|
return NewConnectionsExternalConnectionItemRequestBuilderInternal(urlTplParams, m.requestAdapter)
|
|
}
|
|
// NewExternalRequestBuilderInternal instantiates a new ExternalRequestBuilder and sets the default values.
|
|
func NewExternalRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ExternalRequestBuilder) {
|
|
m := &ExternalRequestBuilder{
|
|
}
|
|
m.urlTemplate = "{+baseurl}/external{?%24select,%24expand}";
|
|
urlTplParams := make(map[string]string)
|
|
for idx, item := range pathParameters {
|
|
urlTplParams[idx] = item
|
|
}
|
|
m.pathParameters = urlTplParams
|
|
m.requestAdapter = requestAdapter
|
|
return m
|
|
}
|
|
// NewExternalRequestBuilder instantiates a new ExternalRequestBuilder and sets the default values.
|
|
func NewExternalRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ExternalRequestBuilder) {
|
|
urlParams := make(map[string]string)
|
|
urlParams["request-raw-url"] = rawUrl
|
|
return NewExternalRequestBuilderInternal(urlParams, requestAdapter)
|
|
}
|
|
// Get get external
|
|
func (m *ExternalRequestBuilder) Get(ctx context.Context, requestConfiguration *ExternalRequestBuilderGetRequestConfiguration)(i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable, error) {
|
|
requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration);
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
|
|
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
}
|
|
res, err := m.requestAdapter.Send(ctx, requestInfo, i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.CreateExternalFromDiscriminatorValue, errorMapping)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if res == nil {
|
|
return nil, nil
|
|
}
|
|
return res.(i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable), nil
|
|
}
|
|
// Patch update external
|
|
func (m *ExternalRequestBuilder) Patch(ctx context.Context, body i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable, requestConfiguration *ExternalRequestBuilderPatchRequestConfiguration)(i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable, error) {
|
|
requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration);
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {
|
|
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,
|
|
}
|
|
res, err := m.requestAdapter.Send(ctx, requestInfo, i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.CreateExternalFromDiscriminatorValue, errorMapping)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if res == nil {
|
|
return nil, nil
|
|
}
|
|
return res.(i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable), nil
|
|
}
|
|
// ToGetRequestInformation get external
|
|
func (m *ExternalRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ExternalRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
|
|
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
|
|
requestInfo.UrlTemplate = m.urlTemplate
|
|
requestInfo.PathParameters = m.pathParameters
|
|
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET
|
|
requestInfo.Headers.Add("Accept", "application/json")
|
|
if requestConfiguration != nil {
|
|
if requestConfiguration.QueryParameters != nil {
|
|
requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters))
|
|
}
|
|
requestInfo.Headers.AddAll(requestConfiguration.Headers)
|
|
requestInfo.AddRequestOptions(requestConfiguration.Options)
|
|
}
|
|
return requestInfo, nil
|
|
}
|
|
// ToPatchRequestInformation update external
|
|
func (m *ExternalRequestBuilder) ToPatchRequestInformation(ctx context.Context, body i648e92ed22999203da3c8fad3bc63deefe974fd0d511e7f830d70ea0aff57ffc.Externalable, requestConfiguration *ExternalRequestBuilderPatchRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
|
|
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
|
|
requestInfo.UrlTemplate = m.urlTemplate
|
|
requestInfo.PathParameters = m.pathParameters
|
|
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH
|
|
requestInfo.Headers.Add("Accept", "application/json")
|
|
err := requestInfo.SetContentFromParsable(ctx, m.requestAdapter, "application/json", body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
if requestConfiguration != nil {
|
|
requestInfo.Headers.AddAll(requestConfiguration.Headers)
|
|
requestInfo.AddRequestOptions(requestConfiguration.Options)
|
|
}
|
|
return requestInfo, nil
|
|
}
|