code: func (c *Connector) CreateIfNotExists(ctx context.Context, ei *dosa.EntityInfo, values map[string]dosa.FieldValue) error {
  	ev, err := fieldValueMapFromClientMap(values)
  	if err != nil {
  		return err
  	}
  
  	ttl := dosa.NoTTL().Nanoseconds()
  	if ei.TTL != nil {
  		ttl = ei.TTL.Nanoseconds()
  	}
  
  	createRequest := dosarpc.CreateRequest{
  		Ref:          entityInfoToSchemaRef(ei),
  		EntityValues: ev,
  		TTL:          &ttl,
  	}
  
  	err = c.client.CreateIfNotExists(ctx, &createRequest, getHeaders(c.headers)...)
  	if err != nil {
  		if be, ok := err.(*dosarpc.BadRequestError); ok {
  			if be.ErrorCode != nil && *be.ErrorCode == errCodeAlreadyExists {
  				return errors.Wrap(&dosa.ErrAlreadyExists{}, "failed to create")
  			}
  		}
  
  		if !dosarpc.Dosa_CreateIfNotExists_Helper.IsException(err) {
  			return errors.Wrap(err, "failed to CreateIfNotExists due to network issue")
  		}
  	}
  	return errors.Wrap(err, "failed to CreateIfNotExists")
  }
docs: // CreateIfNotExists ...