func GenerateServiceAccountPolicyInstance(in v1alpha1.ServiceAccountPolicyParameters, p *iam.Policy) {
	p.Bindings = make([]*iam.Binding, len(in.Policy.Bindings))
	for i, v := range in.Policy.Bindings {
		p.Bindings[i] = &iam.Binding{}
		if v.Condition != nil {
			p.Bindings[i].Condition = &iam.Expr{
				Description: gcp.StringValue(v.Condition.Description),
				Expression:  v.Condition.Expression,
				Location:    gcp.StringValue(v.Condition.Location),
				Title:       gcp.StringValue(v.Condition.Title),
			}
		}
		p.Bindings[i].Members = make([]string, len(v.Members))
		copy(p.Bindings[i].Members, v.Members)
		p.Bindings[i].Role = v.Role
	}
	p.AuditConfigs = make([]*iam.AuditConfig, len(in.Policy.AuditConfigs))
	for i, v := range in.Policy.AuditConfigs {
		p.AuditConfigs[i] = &iam.AuditConfig{}
		p.AuditConfigs[i].Service = v.Service
		p.AuditConfigs[i].AuditLogConfigs = make([]*iam.AuditLogConfig, len(v.AuditLogConfigs))
		for ai, av := range v.AuditLogConfigs {
			p.AuditConfigs[i].AuditLogConfigs[ai] = &iam.AuditLogConfig{}
			p.AuditConfigs[i].AuditLogConfigs[ai].LogType = av.LogType
			p.AuditConfigs[i].AuditLogConfigs[ai].ExemptedMembers = make([]string, len(av.ExemptedMembers))
			copy(p.AuditConfigs[i].AuditLogConfigs[ai].ExemptedMembers, av.ExemptedMembers)
		}
	}
	p.Version = iamv1alpha1.PolicyVersion
}
GenerateServiceAccountPolicyInstance generates *iam.Policy instance from ServiceAccountPolicyParameters.
package serviceaccountpolicy
import (
	"github.com/google/go-cmp/cmp"
	"github.com/google/go-cmp/cmp/cmpopts"
	"github.com/mitchellh/copystructure"
	"google.golang.org/api/iam/v1"
	"github.com/crossplane/crossplane-runtime/pkg/errors"
	"github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
	iamv1alpha1 "github.com/crossplane/provider-gcp/apis/iam/v1alpha1"
	gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
const errCheckUpToDate = "unable to determine if external resource is up to date"
type Client interface {
	GetIamPolicy(resource string) *iam.ProjectsServiceAccountsGetIamPolicyCall
	SetIamPolicy(resource string, setiampolicyrequest *iam.SetIamPolicyRequest) *iam.ProjectsServiceAccountsSetIamPolicyCall
}