public string CreateTeamInvitation(StreetTeamInvitationsModel invitationToCreate)
 {
     var request = PrepareTeamInvitationCreateRequest(invitationToCreate);
     return _tokenManager.ExecuteCreate(request);
 }
 public void CreateTeamInvitationAsync(Action<string> success, Action<HealthGraphException> failure, StreetTeamInvitationsModel invitationToCreate)
 {
     var request = PrepareTeamInvitationCreateRequest(invitationToCreate);
     _tokenManager.ExecuteCreateAsync(request, success, failure);
 }
        /// <summary>
        /// Prepares the request object to create a new model.
        /// </summary>
        /// <param name="invitationToCreate"></param>
        /// <returns></returns>
        private IRestRequest PrepareTeamInvitationCreateRequest(StreetTeamInvitationsModel invitationToCreate)
        {
            var request = new RestRequest(Method.POST);
            request.Resource = _user.Team;

            //Add body to the request
            request.AddParameter(StreetTeamInvitationsModel.ContentType, _tokenManager.DefaultJsonSerializer.Serialize(new
            {
                userID = invitationToCreate.UserID
            }), ParameterType.RequestBody);
            return request;
        }