func awsRestjson1_deserializeOpDocumentDescribeBrokerOutput()

in service/mq/deserializers.go [1281:1551]


func awsRestjson1_deserializeOpDocumentDescribeBrokerOutput(v **DescribeBrokerOutput, value interface{}) error {
	if v == nil {
		return fmt.Errorf("unexpected nil of type %T", v)
	}
	if value == nil {
		return nil
	}

	shape, ok := value.(map[string]interface{})
	if !ok {
		return fmt.Errorf("unexpected JSON type %v", value)
	}

	var sv *DescribeBrokerOutput
	if *v == nil {
		sv = &DescribeBrokerOutput{}
	} else {
		sv = *v
	}

	for key, value := range shape {
		switch key {
		case "actionsRequired":
			if err := awsRestjson1_deserializeDocument__listOfActionRequired(&sv.ActionsRequired, value); err != nil {
				return err
			}

		case "authenticationStrategy":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value)
				}
				sv.AuthenticationStrategy = types.AuthenticationStrategy(jtv)
			}

		case "autoMinorVersionUpgrade":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
				}
				sv.AutoMinorVersionUpgrade = ptr.Bool(jtv)
			}

		case "brokerArn":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.BrokerArn = ptr.String(jtv)
			}

		case "brokerId":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.BrokerId = ptr.String(jtv)
			}

		case "brokerInstances":
			if err := awsRestjson1_deserializeDocument__listOfBrokerInstance(&sv.BrokerInstances, value); err != nil {
				return err
			}

		case "brokerName":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.BrokerName = ptr.String(jtv)
			}

		case "brokerState":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected BrokerState to be of type string, got %T instead", value)
				}
				sv.BrokerState = types.BrokerState(jtv)
			}

		case "configurations":
			if err := awsRestjson1_deserializeDocumentConfigurations(&sv.Configurations, value); err != nil {
				return err
			}

		case "created":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value)
				}
				t, err := smithytime.ParseDateTime(jtv)
				if err != nil {
					return err
				}
				sv.Created = ptr.Time(t)
			}

		case "dataReplicationMetadata":
			if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.DataReplicationMetadata, value); err != nil {
				return err
			}

		case "dataReplicationMode":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value)
				}
				sv.DataReplicationMode = types.DataReplicationMode(jtv)
			}

		case "deploymentMode":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DeploymentMode to be of type string, got %T instead", value)
				}
				sv.DeploymentMode = types.DeploymentMode(jtv)
			}

		case "encryptionOptions":
			if err := awsRestjson1_deserializeDocumentEncryptionOptions(&sv.EncryptionOptions, value); err != nil {
				return err
			}

		case "engineType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected EngineType to be of type string, got %T instead", value)
				}
				sv.EngineType = types.EngineType(jtv)
			}

		case "engineVersion":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.EngineVersion = ptr.String(jtv)
			}

		case "hostInstanceType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.HostInstanceType = ptr.String(jtv)
			}

		case "ldapServerMetadata":
			if err := awsRestjson1_deserializeDocumentLdapServerMetadataOutput(&sv.LdapServerMetadata, value); err != nil {
				return err
			}

		case "logs":
			if err := awsRestjson1_deserializeDocumentLogsSummary(&sv.Logs, value); err != nil {
				return err
			}

		case "maintenanceWindowStartTime":
			if err := awsRestjson1_deserializeDocumentWeeklyStartTime(&sv.MaintenanceWindowStartTime, value); err != nil {
				return err
			}

		case "pendingAuthenticationStrategy":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected AuthenticationStrategy to be of type string, got %T instead", value)
				}
				sv.PendingAuthenticationStrategy = types.AuthenticationStrategy(jtv)
			}

		case "pendingDataReplicationMetadata":
			if err := awsRestjson1_deserializeDocumentDataReplicationMetadataOutput(&sv.PendingDataReplicationMetadata, value); err != nil {
				return err
			}

		case "pendingDataReplicationMode":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DataReplicationMode to be of type string, got %T instead", value)
				}
				sv.PendingDataReplicationMode = types.DataReplicationMode(jtv)
			}

		case "pendingEngineVersion":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.PendingEngineVersion = ptr.String(jtv)
			}

		case "pendingHostInstanceType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected __string to be of type string, got %T instead", value)
				}
				sv.PendingHostInstanceType = ptr.String(jtv)
			}

		case "pendingLdapServerMetadata":
			if err := awsRestjson1_deserializeDocumentLdapServerMetadataOutput(&sv.PendingLdapServerMetadata, value); err != nil {
				return err
			}

		case "pendingSecurityGroups":
			if err := awsRestjson1_deserializeDocument__listOf__string(&sv.PendingSecurityGroups, value); err != nil {
				return err
			}

		case "publiclyAccessible":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
				}
				sv.PubliclyAccessible = ptr.Bool(jtv)
			}

		case "securityGroups":
			if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil {
				return err
			}

		case "storageType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected BrokerStorageType to be of type string, got %T instead", value)
				}
				sv.StorageType = types.BrokerStorageType(jtv)
			}

		case "subnetIds":
			if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SubnetIds, value); err != nil {
				return err
			}

		case "tags":
			if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil {
				return err
			}

		case "users":
			if err := awsRestjson1_deserializeDocument__listOfUserSummary(&sv.Users, value); err != nil {
				return err
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}