-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pass by ref related microsoft/kiota#3830
- Loading branch information
Showing
14 changed files
with
938 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 85 additions & 75 deletions
160
organization/item_branding_banner_logo_request_builder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,115 @@ | ||
package organization | ||
|
||
import ( | ||
"context" | ||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" | ||
ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" | ||
"context" | ||
|
||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" | ||
ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors" | ||
) | ||
|
||
// ItemBrandingBannerLogoRequestBuilder provides operations to manage the media for the organization entity. | ||
type ItemBrandingBannerLogoRequestBuilder struct { | ||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder | ||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder | ||
} | ||
|
||
// ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. | ||
type ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration struct { | ||
// Request headers | ||
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders | ||
// Request options | ||
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption | ||
// Request headers | ||
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders | ||
// Request options | ||
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption | ||
} | ||
|
||
// ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. | ||
type ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration struct { | ||
// Request headers | ||
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders | ||
// Request options | ||
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption | ||
// Request headers | ||
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders | ||
// Request options | ||
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption | ||
} | ||
|
||
// NewItemBrandingBannerLogoRequestBuilderInternal instantiates a new BannerLogoRequestBuilder and sets the default values. | ||
func NewItemBrandingBannerLogoRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBrandingBannerLogoRequestBuilder) { | ||
m := &ItemBrandingBannerLogoRequestBuilder{ | ||
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organization/{organization%2Did}/branding/bannerLogo", pathParameters), | ||
} | ||
return m | ||
func NewItemBrandingBannerLogoRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemBrandingBannerLogoRequestBuilder { | ||
m := &ItemBrandingBannerLogoRequestBuilder{ | ||
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organization/{organization%2Did}/branding/bannerLogo", pathParameters), | ||
} | ||
return m | ||
} | ||
|
||
// NewItemBrandingBannerLogoRequestBuilder instantiates a new BannerLogoRequestBuilder and sets the default values. | ||
func NewItemBrandingBannerLogoRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemBrandingBannerLogoRequestBuilder) { | ||
urlParams := make(map[string]string) | ||
urlParams["request-raw-url"] = rawUrl | ||
return NewItemBrandingBannerLogoRequestBuilderInternal(urlParams, requestAdapter) | ||
func NewItemBrandingBannerLogoRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemBrandingBannerLogoRequestBuilder { | ||
urlParams := make(map[string]string) | ||
urlParams["request-raw-url"] = rawUrl | ||
return NewItemBrandingBannerLogoRequestBuilderInternal(urlParams, requestAdapter) | ||
} | ||
|
||
// Get a banner version of your company logo that appears on the sign-in page. The allowed types are PNG or JPEG not larger than 36 × 245 pixels. We recommend using a transparent image with no padding around the logo. | ||
// [Find more info here] | ||
// | ||
// | ||
// [Find more info here]: https://learn.microsoft.com/graph/api/organizationalbranding-get?view=graph-rest-1.0 | ||
func (m *ItemBrandingBannerLogoRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration)([]byte, 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.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if res == nil { | ||
return nil, nil | ||
} | ||
return res.([]byte), nil | ||
func (m *ItemBrandingBannerLogoRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration) ([]byte, 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.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if res == nil { | ||
return nil, nil | ||
} | ||
return res.([]byte), nil | ||
} | ||
|
||
// Put a banner version of your company logo that appears on the sign-in page. The allowed types are PNG or JPEG not larger than 36 × 245 pixels. We recommend using a transparent image with no padding around the logo. | ||
func (m *ItemBrandingBannerLogoRequestBuilder) Put(ctx context.Context, body []byte, contentType *string, requestConfiguration *ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration)([]byte, error) { | ||
requestInfo, err := m.ToPutRequestInformation(ctx, body, contentType, requestConfiguration); | ||
if err != nil { | ||
return nil, err | ||
} | ||
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { | ||
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, | ||
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, | ||
} | ||
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if res == nil { | ||
return nil, nil | ||
} | ||
return res.([]byte), nil | ||
func (m *ItemBrandingBannerLogoRequestBuilder) Put(ctx context.Context, body []byte, contentType *string, requestConfiguration *ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration) ([]byte, error) { | ||
requestInfo, err := m.ToPutRequestInformation(ctx, body, contentType, requestConfiguration) | ||
if err != nil { | ||
return nil, err | ||
} | ||
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ | ||
"4XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, | ||
"5XX": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue, | ||
} | ||
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if res == nil { | ||
return nil, nil | ||
} | ||
return res.([]byte), nil | ||
} | ||
|
||
// ToGetRequestInformation a banner version of your company logo that appears on the sign-in page. The allowed types are PNG or JPEG not larger than 36 × 245 pixels. We recommend using a transparent image with no padding around the logo. | ||
func (m *ItemBrandingBannerLogoRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { | ||
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) | ||
if requestConfiguration != nil { | ||
requestInfo.Headers.AddAll(requestConfiguration.Headers) | ||
requestInfo.AddRequestOptions(requestConfiguration.Options) | ||
} | ||
requestInfo.Headers.TryAdd("Accept", "image/bmp, image/jpg, image/jpeg, image/gif, image/vnd.microsoft.icon, image/png, image/tiff, application/json") | ||
return requestInfo, nil | ||
func (m *ItemBrandingBannerLogoRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemBrandingBannerLogoRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { | ||
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) | ||
if requestConfiguration != nil { | ||
requestInfo.Headers.AddAll(requestConfiguration.Headers) | ||
requestInfo.AddRequestOptions(requestConfiguration.Options) | ||
} | ||
requestInfo.Headers.TryAdd("Accept", "image/bmp, image/jpg, image/jpeg, image/gif, image/vnd.microsoft.icon, image/png, image/tiff, application/json") | ||
return requestInfo, nil | ||
} | ||
|
||
// ToPutRequestInformation a banner version of your company logo that appears on the sign-in page. The allowed types are PNG or JPEG not larger than 36 × 245 pixels. We recommend using a transparent image with no padding around the logo. | ||
func (m *ItemBrandingBannerLogoRequestBuilder) ToPutRequestInformation(ctx context.Context, body []byte, contentType *string, requestConfiguration *ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration)(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { | ||
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) | ||
if requestConfiguration != nil { | ||
requestInfo.Headers.AddAll(requestConfiguration.Headers) | ||
requestInfo.AddRequestOptions(requestConfiguration.Options) | ||
} | ||
requestInfo.Headers.TryAdd("Accept", "application/json") | ||
requestInfo.SetStreamContentAndContentType(body, contentType) | ||
return requestInfo, nil | ||
func (m *ItemBrandingBannerLogoRequestBuilder) ToPutRequestInformation(ctx context.Context, body []byte, contentType *string, requestConfiguration *ItemBrandingBannerLogoRequestBuilderPutRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { | ||
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) | ||
if requestConfiguration != nil { | ||
requestInfo.Headers.AddAll(requestConfiguration.Headers) | ||
requestInfo.AddRequestOptions(requestConfiguration.Options) | ||
} | ||
requestInfo.Headers.TryAdd("Accept", "application/json") | ||
requestInfo.SetStreamContentAndContentType(body, *contentType) | ||
return requestInfo, nil | ||
} | ||
|
||
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. | ||
func (m *ItemBrandingBannerLogoRequestBuilder) WithUrl(rawUrl string)(*ItemBrandingBannerLogoRequestBuilder) { | ||
return NewItemBrandingBannerLogoRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); | ||
func (m *ItemBrandingBannerLogoRequestBuilder) WithUrl(rawUrl string) *ItemBrandingBannerLogoRequestBuilder { | ||
return NewItemBrandingBannerLogoRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) | ||
} |
Oops, something went wrong.