// OldHashedGrantToken returns the old "hashed_grant_token" field's value of the APIAudit entity.
// If the APIAudit object wasn't provided to the builder, the object is fetched from the database.
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
OldHashedGrantToken returns the old "hashed_grant_token" field's value of the APIAudit entity.
If the APIAudit object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails.
// OldHashedGrantToken returns the old " hashed_grant_token " field ' s value of the APIAudit entity . // If the APIAudit object wasn ' t provided to the builder the object is fetched from the database . // An error is returned if the mutation operation is not UpdateOne or the database query fails .
func (m *APIAuditMutation) OldHashedGrantToken(ctx context.Context) (v string, err error) {
	if !m.op.Is(OpUpdateOne) {
		return v, fmt.Errorf("OldHashedGrantToken is only allowed on UpdateOne operations")
	}
	if m.id == nil || m.oldValue == nil {
		return v, fmt.Errorf("OldHashedGrantToken requires an ID field in the mutation")
	}
	oldValue, err := m.oldValue(ctx)
	if err != nil {
		return v, fmt.Errorf("querying old value for OldHashedGrantToken: %w", err)
	}
	return oldValue.HashedGrantToken, nil
}
func ( m * APIAuditMutation ) OldHashedGrantToken ( ctx context . Context ) ( v string , err error ) { if ! m . op . Is ( OpUpdateOne ) { return v , fmt . Errorf ( " " ) } if m . id == nil || m . oldValue == nil { return v , fmt . Errorf ( " " ) } oldValue , err := m . oldValue ( ctx ) if err != nil { return v , fmt . Errorf ( " " , err ) } return oldValue . HashedGrantToken , nil }
OldHashedGrantToken returns the old "hashed_grant_token" field's value of the APIAudit entity.
OldHashedGrantToken returns the old " hashed_grant_token " field ' s value of the APIAudit entity .