Skip to content

Commit

Permalink
removePassword for kiota
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl committed Apr 16, 2024
1 parent 8878b0d commit ebc9286
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 1 deletion.
39 changes: 39 additions & 0 deletions hack/graphsdk/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,45 @@ paths:
schema:
type: string
x-ms-docs-key-type: application
'/applications/{application-id}/removePassword':
description: Provides operations to call the removePassword method.
post:
tags:
- applications.Actions
summary: Invoke action removePassword
description: Remove a password from an application.
externalDocs:
description: Find more info here
url: https://learn.microsoft.com/graph/api/application-removepassword?view=graph-rest-1.0
operationId: applications.application.removePassword
requestBody:
description: Action parameters
content:
application/json:
schema:
type: object
properties:
keyId:
pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
type: string
format: uuid
required: true
responses:
'204':
description: Success
4XX:
$ref: '#/components/responses/error'
5XX:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: action
parameters:
- name: application-id
in: path
description: The unique identifier of application
required: true
schema:
type: string
x-ms-docs-key-type: application
/servicePrincipals:
description: Provides operations to manage the collection of servicePrincipal entities.
get:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func (m *ApplicationItemRequestBuilder) Patch(ctx context.Context, body i6a02252
return res.(i6a022527509c6c974d313985d6b1e1814af5796dab5da8f53d13c951e06bb0cd.Applicationable), nil
}

// RemovePassword provides operations to call the removePassword method.
func (m *ApplicationItemRequestBuilder) RemovePassword() *ItemRemovePasswordRequestBuilder {
return NewItemRemovePasswordRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)
}

// ToDeleteRequestInformation delete an application object. When deleted, apps are moved to a temporary container and can be restored within 30 days. After that time, they are permanently deleted.
func (m *ApplicationItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ApplicationItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package applications

// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.

import (
i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store"
)

// ItemRemovePasswordPostRequestBody
type ItemRemovePasswordPostRequestBody struct {
// Stores model information.
backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore
}

// NewItemRemovePasswordPostRequestBody instantiates a new ItemRemovePasswordPostRequestBody and sets the default values.
func NewItemRemovePasswordPostRequestBody() *ItemRemovePasswordPostRequestBody {
m := &ItemRemovePasswordPostRequestBody{}
m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance()
return m
}

// CreateItemRemovePasswordPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateItemRemovePasswordPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewItemRemovePasswordPostRequestBody(), nil
}

// GetBackingStore gets the backingStore property value. Stores model information.
func (m *ItemRemovePasswordPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore {
return m.backingStore
}

// GetFieldDeserializers the deserialization information for the current model
func (m *ItemRemovePasswordPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error)
res["keyId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetUUIDValue()
if err != nil {
return err
}
if val != nil {
m.SetKeyId(val)
}
return nil
}
return res
}

// GetKeyId gets the keyId property value. The keyId property
func (m *ItemRemovePasswordPostRequestBody) GetKeyId() *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID {
val, err := m.GetBackingStore().Get("keyId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)
}
return nil
}

// Serialize serializes information the current object
func (m *ItemRemovePasswordPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error {
{
err := writer.WriteUUIDValue("keyId", m.GetKeyId())
if err != nil {
return err
}
}
return nil
}

// SetBackingStore sets the backingStore property value. Stores model information.
func (m *ItemRemovePasswordPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) {
m.backingStore = value
}

// SetKeyId sets the keyId property value. The keyId property
func (m *ItemRemovePasswordPostRequestBody) SetKeyId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) {
err := m.GetBackingStore().Set("keyId", value)
if err != nil {
panic(err)
}
}

// ItemRemovePasswordPostRequestBodyable
type ItemRemovePasswordPostRequestBodyable interface {
ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore
GetKeyId() *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID
SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)
SetKeyId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package applications

// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.

import (
"context"

i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"

i590dfc7f28a1fc5720c211d996119093307169ae10220ddded8912d222cbd376 "github.com/Azure/ARO-RP/pkg/util/graph/graphsdk/models/odataerrors"
)

// ItemRemovePasswordRequestBuilder provides operations to call the removePassword method.
type ItemRemovePasswordRequestBuilder struct {
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder
}

// ItemRemovePasswordRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options.
type ItemRemovePasswordRequestBuilderPostRequestConfiguration struct {
// Request headers
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders
// Request options
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption
}

// NewItemRemovePasswordRequestBuilderInternal instantiates a new RemovePasswordRequestBuilder and sets the default values.
func NewItemRemovePasswordRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemRemovePasswordRequestBuilder {
m := &ItemRemovePasswordRequestBuilder{
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{application%2Did}/removePassword", pathParameters),
}
return m
}

// NewItemRemovePasswordRequestBuilder instantiates a new RemovePasswordRequestBuilder and sets the default values.
func NewItemRemovePasswordRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemRemovePasswordRequestBuilder {
urlParams := make(map[string]string)
urlParams["request-raw-url"] = rawUrl
return NewItemRemovePasswordRequestBuilderInternal(urlParams, requestAdapter)
}

// Post remove a password from an application.
// [Find more info here]
//
// [Find more info here]: https://learn.microsoft.com/graph/api/application-removepassword?view=graph-rest-1.0
func (m *ItemRemovePasswordRequestBuilder) Post(ctx context.Context, body ItemRemovePasswordPostRequestBodyable, requestConfiguration *ItemRemovePasswordRequestBuilderPostRequestConfiguration) error {
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration)
if err != nil {
return err
}
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
"4XX": i590dfc7f28a1fc5720c211d996119093307169ae10220ddded8912d222cbd376.CreateODataErrorFromDiscriminatorValue,
"5XX": i590dfc7f28a1fc5720c211d996119093307169ae10220ddded8912d222cbd376.CreateODataErrorFromDiscriminatorValue,
}
err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)
if err != nil {
return err
}
return nil
}

// ToPostRequestInformation remove a password from an application.
func (m *ItemRemovePasswordRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemRemovePasswordPostRequestBodyable, requestConfiguration *ItemRemovePasswordRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformation()
requestInfo.UrlTemplate = m.BaseRequestBuilder.UrlTemplate
requestInfo.PathParameters = m.BaseRequestBuilder.PathParameters
requestInfo.Method = i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST
err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.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
}
2 changes: 1 addition & 1 deletion pkg/util/graph/graphsdk/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "375409869FC06AED23DD1BF5BE90B682DD45E3215C6CC1AFBE7C3DC9EFC844B9300C2CB898E5A7FA5A753E429769E52BC078C62DDAE536C9C1AD7954FE8308D2",
"descriptionHash": "17C2A4DF175C4AF2DA1FA6A282F214DCAB84CF3343F544514273122D82AB33A0E2C15B1F3827DA5C3636ECB996475CF99A043FF1D31CD4152FC2AF7F2B4651FF",
"descriptionLocation": "/home/hawkowl/code/ARO-RP/hack/graphsdk/openapi.yaml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.5.1",
Expand Down

0 comments on commit ebc9286

Please sign in to comment.