// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iotsitewise import ( "context" "time" "github.com/aws/aws-sdk-go-v2/aws" ) // WaitUntilAssetActive uses the AWS IoT SiteWise API operation // DescribeAsset to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilAssetActive(ctx context.Context, input *DescribeAssetInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilAssetActive", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.PathWaiterMatch, Argument: "assetStatus.state", Expected: "ACTIVE", }, { State: aws.FailureWaiterState, Matcher: aws.PathWaiterMatch, Argument: "assetStatus.state", Expected: "FAILED", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribeAssetInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribeAssetRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) } // WaitUntilAssetModelActive uses the AWS IoT SiteWise API operation // DescribeAssetModel to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilAssetModelActive(ctx context.Context, input *DescribeAssetModelInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilAssetModelActive", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.PathWaiterMatch, Argument: "assetModelStatus.state", Expected: "ACTIVE", }, { State: aws.FailureWaiterState, Matcher: aws.PathWaiterMatch, Argument: "assetModelStatus.state", Expected: "FAILED", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribeAssetModelInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribeAssetModelRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) } // WaitUntilAssetModelNotExists uses the AWS IoT SiteWise API operation // DescribeAssetModel to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilAssetModelNotExists(ctx context.Context, input *DescribeAssetModelInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilAssetModelNotExists", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribeAssetModelInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribeAssetModelRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) } // WaitUntilAssetNotExists uses the AWS IoT SiteWise API operation // DescribeAsset to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilAssetNotExists(ctx context.Context, input *DescribeAssetInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilAssetNotExists", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribeAssetInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribeAssetRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) } // WaitUntilPortalActive uses the AWS IoT SiteWise API operation // DescribePortal to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilPortalActive(ctx context.Context, input *DescribePortalInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilPortalActive", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.PathWaiterMatch, Argument: "portalStatus.state", Expected: "ACTIVE", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribePortalInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribePortalRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) } // WaitUntilPortalNotExists uses the AWS IoT SiteWise API operation // DescribePortal to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will // be returned. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *Client) WaitUntilPortalNotExists(ctx context.Context, input *DescribePortalInput, opts ...aws.WaiterOption) error { w := aws.Waiter{ Name: "WaitUntilPortalNotExists", MaxAttempts: 20, Delay: aws.ConstantWaiterDelay(3 * time.Second), Acceptors: []aws.WaiterAcceptor{ { State: aws.SuccessWaiterState, Matcher: aws.ErrorWaiterMatch, Expected: "ResourceNotFoundException", }, }, Logger: c.Config.Logger, NewRequest: func(opts []aws.Option) (*aws.Request, error) { var inCpy *DescribePortalInput if input != nil { tmp := *input inCpy = &tmp } req := c.DescribePortalRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req.Request, nil }, } w.ApplyOptions(opts...) return w.Wait(ctx) }