func (c *SecretsManager) CreateSecretWithRecordData(recUid, folderUid string, recordData *RecordCreate) (recordUid string, err error) {
	// Backend only needs a JSON string of the record, so we have different ways of handing data:
	//   - providing data as JSON string
	//   - providing data as map[string]interface{}
	//   - providing data as CreateRecord struct
	// Here we will use CreateRecord objects

	if recordData == nil || recordData.RecordType == "" || recordData.Title == "" {
		return "", errors.New("new record data has to be a valid 'RecordCreate' object")
	}

	// Since we don't know folder's key where this record will be placed in,
	// currently we have to retrieve all data that is share to this device/client
	// and look for the folder's key in the returned folder data

	_, folders, err := c.getSecretsFullResponse([]string{})
	if err != nil {
		return "", err
	}

	foundFolder := GetFolderByKey(folderUid, folders)
	if foundFolder == nil {
		return "", fmt.Errorf("folder uid='%s' was not retrieved. If you are creating a record in a "+
			"shared folder that you know exists, make sure that at least one record is present in "+
			"the folder prior to adding a new record", folderUid)
	}

	record := NewRecordFromRecordDataWithUid(recUid, recordData, foundFolder)
	if record == nil {
		return "", fmt.Errorf("failed to create new record from record data: %v", recordData)
	}
	payload, err := c.prepareCreatePayload(record)
	if err != nil {
		return "", err
	}

	_, err = c.PostQuery("create_secret", payload)
	return payload.RecordUid, err
}
// CreateSecretWithRecordData creates new record using recordUID, folderUID and record data provided
// Note: if param recUid is empty - new auto generated record UID will be used
CreateSecretWithRecordData creates new record using recordUID, folderUID and record data provided
Note: if param recUid is empty - new auto generated record UID will be used
// CreateSecretWithRecordData creates new record using recordUID folderUID and record data provided // Note : if param recUid is empty - new auto generated record UID will be used
func (c *SecretsManager) CreateSecretWithRecordData(recUid, folderUid string, recordData *RecordCreate) (recordUid string, err error) {
	if recordData == nil || recordData.RecordType == "" || recordData.Title == "" {
		return "", errors.New("new record data has to be a valid 'RecordCreate' object")
	}
	_, folders, err := c.getSecretsFullResponse([]string{})
	if err != nil {
		return "", err
	}
	foundFolder := GetFolderByKey(folderUid, folders)
	if foundFolder == nil {
		return "", fmt.Errorf("folder uid='%s' was not retrieved. If you are creating a record in a "+
			"shared folder that you know exists, make sure that at least one record is present in "+
			"the folder prior to adding a new record", folderUid)
	}
	record := NewRecordFromRecordDataWithUid(recUid, recordData, foundFolder)
	if record == nil {
		return "", fmt.Errorf("failed to create new record from record data: %v", recordData)
	}
	payload, err := c.prepareCreatePayload(record)
	if err != nil {
		return "", err
	}
	_, err = c.PostQuery("create_secret", payload)
	return payload.RecordUid, err
}
func ( c * SecretsManager ) CreateSecretWithRecordData ( recUid , folderUid string , recordData * RecordCreate ) ( recordUid string , err error ) { if recordData == nil || recordData . RecordType == " " || recordData . Title == " " { return " " , errors . New ( " " ) } _ , folders , err := c . getSecretsFullResponse ( [ ] string { } ) if err != nil { return " " , err } foundFolder := GetFolderByKey ( folderUid , folders ) if foundFolder == nil { return " " , fmt . Errorf ( " " + " " + " " , folderUid ) } record := NewRecordFromRecordDataWithUid ( recUid , recordData , foundFolder ) if record == nil { return " " , fmt . Errorf ( " " , recordData ) } payload , err := c . prepareCreatePayload ( record ) if err != nil { return " " , err } _ , err = c . PostQuery ( " " , payload ) return payload . RecordUid , err }
CreateSecretWithRecordData creates new record using recordUID, folderUID and record data provided
Note: if param recUid is empty - new auto generated record UID will be used
CreateSecretWithRecordData creates new record using recordUID folderUID and record data provided Note : if param recUid is empty - new auto generated record UID will be used
// Backend only needs a JSON string of the record, so we have different ways of handing data: //   - providing data as JSON string //   - providing data as map[string]interface{} //   - providing data as CreateRecord struct // Here we will use CreateRecord objects // Since we don't know folder's key where this record will be placed in, // currently we have to retrieve all data that is share to this device/client // and look for the folder's key in the returned folder data