// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.

package dynamodb

import (
	"github.com/aws/aws-sdk-go/private/waiter"
)

var waiterTableExists *waiter.Config

func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error {
	if waiterTableExists == nil {
		waiterTableExists = &waiter.Config{
			Operation:   "DescribeTable",
			Delay:       20,
			MaxAttempts: 25,
			Acceptors: []waiter.WaitAcceptor{
				{
					State:    "success",
					Matcher:  "path",
					Argument: "Table.TableStatus",
					Expected: "ACTIVE",
				},
				{
					State:    "retry",
					Matcher:  "error",
					Argument: "",
					Expected: "ResourceNotFoundException",
				},
			},
		}
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterTableExists,
	}
	return w.Wait()
}

var waiterTableNotExists *waiter.Config

func (c *DynamoDB) WaitUntilTableNotExists(input *DescribeTableInput) error {
	if waiterTableNotExists == nil {
		waiterTableNotExists = &waiter.Config{
			Operation:   "DescribeTable",
			Delay:       20,
			MaxAttempts: 25,
			Acceptors: []waiter.WaitAcceptor{
				{
					State:    "success",
					Matcher:  "error",
					Argument: "",
					Expected: "ResourceNotFoundException",
				},
			},
		}
	}

	w := waiter.Waiter{
		Client: c,
		Input:  input,
		Config: waiterTableNotExists,
	}
	return w.Wait()
}
