// IsTrivialTypeChange returns if this db type be trivially reassigned
// without changes to the replication graph
485181
func IsTrivialTypeChange(oldTabletType, newTabletType topodatapb.TabletType) bool {
	switch oldTabletType {
	case topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY, topodatapb.TabletType_SPARE, topodatapb.TabletType_BACKUP, topodatapb.TabletType_EXPERIMENTAL, topodatapb.TabletType_DRAINED:
		switch newTabletType {
		case topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY, topodatapb.TabletType_SPARE, topodatapb.TabletType_BACKUP, topodatapb.TabletType_EXPERIMENTAL, topodatapb.TabletType_DRAINED:
			return true
		}
	case topodatapb.TabletType_RESTORE:
		switch newTabletType {
		case topodatapb.TabletType_SPARE:
			return true
		}
	}
	return false
}
1259895
func NewTfaChangePolicyType(Description string) *TfaChangePolicyType {
	s := new(TfaChangePolicyType)
	s.Description = Description
	return s
}
1102614
func (client *Client) ChangeType(ctx context.Context, tablet *topodatapb.Tablet, dbType topodatapb.TabletType) error {
	cc, c, err := client.dial(tablet)
	if err != nil {
		return err
	}
	defer cc.Close()
	_, err = c.ChangeType(ctx, &tabletmanagerdatapb.ChangeTypeRequest{
		TabletType: dbType,
	})
	return err
}
989408
func NewDataPlacementRestrictionChangePolicyType(Description string) *DataPlacementRestrictionChangePolicyType {
	s := new(DataPlacementRestrictionChangePolicyType)
	s.Description = Description
	return s
}
653869
func (e *entry) InfluxQLType() (influxql.DataType, error) {
	e.mu.RLock()
	defer e.mu.RUnlock()
	return e.values.InfluxQLType()
}
74960
func (s *Parameter) SetChangeType(v string) *Parameter {
	s.ChangeType = &v
	return s
}
1100180
func NewSharingChangeFolderJoinPolicyType(Description string) *SharingChangeFolderJoinPolicyType {
	s := new(SharingChangeFolderJoinPolicyType)
	s.Description = Description
	return s
}
259720
func NewMemberChangeStatusType(Description string) *MemberChangeStatusType {
	s := new(MemberChangeStatusType)
	s.Description = Description
	return s
}
1367635
func (d *InstanceDiff) ChangeType() DiffChangeType {
	if d.Empty() {
		return DiffNone
	}

	if d.RequiresNew() && (d.GetDestroy() || d.GetDestroyTainted()) {
		return DiffDestroyCreate
	}

	if d.GetDestroy() || d.GetDestroyDeposed() {
		return DiffDestroy
	}

	if d.RequiresNew() {
		return DiffCreate
	}

	return DiffUpdate
}
194680
func (client *Client) ModifyDBInstancePayType(args *ModifyDBInstancePayTypeArgs) (resp *ModifyDBInstancePayTypeResponse, err error) {
	response := ModifyDBInstancePayTypeResponse{}
	err = client.Invoke("ModifyDBInstancePayType", args, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}
123060
func NewSharedLinkChangeVisibilityType(Description string) *SharedLinkChangeVisibilityType {
	s := new(SharedLinkChangeVisibilityType)
	s.Description = Description
	return s
}
562796
func HasChangeTrigger(config *appsv1.DeploymentConfig) bool {
	for _, trigger := range config.Spec.Triggers {
		if trigger.Type == appsv1.DeploymentTriggerOnConfigChange {
			return true
		}
	}
	return false
}
761632
func IsTypeTemporal(tp byte) bool {
	switch tp {
	case mysql.TypeDuration, mysql.TypeDatetime, mysql.TypeTimestamp,
		mysql.TypeDate, mysql.TypeNewDate:
		return true
	}
	return false
}
1239561
func (q *StreamHealthQueryService) UpdateType(tabletType topodatapb.TabletType) {
	q.target.TabletType = tabletType
}
264029
func IsTypeChar(tp byte) bool {
	switch tp {
	case mysql.TypeString, mysql.TypeVarchar:
		return true
	default:
		return false
	}
}
158172
func PublishIngressNetworkChange(backend Backend, relationTag names.Tag, change params.IngressNetworksChangeEvent) error {
	logger.Debugf("publish into model %v network change for %v: %+v", backend.ModelUUID(), relationTag, change)

	// Ensure the relation exists.
	rel, err := backend.KeyRelation(relationTag.Id())
	if errors.IsNotFound(err) {
		return nil
	}
	if err != nil {
		return errors.Trace(err)
	}

	logger.Debugf("relation %v requires ingress networks %v", rel, change.Networks)
	if err := validateIngressNetworks(backend, change.Networks); err != nil {
		return errors.Trace(err)
	}

	_, err = backend.SaveIngressNetworks(rel.Tag().Id(), change.Networks)
	return err
}
485510
func (api *CrossModelRelationsAPI) PublishIngressNetworkChanges(
	changes params.IngressNetworksChanges,
) (params.ErrorResults, error) {
	results := params.ErrorResults{
		Results: make([]params.ErrorResult, len(changes.Changes)),
	}
	for i, change := range changes.Changes {
		relationTag, err := api.st.GetRemoteEntity(change.RelationToken)
		if err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
		logger.Debugf("relation tag for token %+v is %v", change.RelationToken, relationTag)

		if err := api.checkMacaroonsForRelation(relationTag, change.Macaroons); err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
		if err := commoncrossmodel.PublishIngressNetworkChange(api.st, relationTag, change); err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
	}
	return results, nil
}