Ejemplo n.º 1
0
        /// <summary>
        /// Create a mail label
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="name">Name for new label</param>
        /// <param name="color">Hexadecimal string representing label color, in RGB format</param>
        /// <returns>Label created</returns>
        public ESIResponse <long> CreateLabel(string authToken, int characterId, string name, string color)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/mail/labels/", authToken);

            request.AddJsonBody(new { name, color });

            return(_httpClient.Execute <long>(request));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create and send a new mail
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="mailInput">The mail to send</param>
        /// <returns>Mail ID</returns>
        public ESIResponse <int> SendMail(string authToken, int characterId, SendMailInput mailInput)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/mail/", authToken);

            request.AddJsonBody(mailInput);

            return(_httpClient.Execute <int>(request));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Invite a character into the fleet. If a character has a CSPA charge set it is not possible to invite them to the fleet using ESI
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="fleetId">ID for a fleet</param>
        /// <param name="characterId">The character you want to invite</param>
        /// <param name="role">
        /// If a character is invited with the fleet_commander role, neither wing_id or squad_id should be specified.
        /// If a character is invited with the wing_commander role, only wing_id should be specified.
        /// If a character is invited with the squad_commander role, both wing_id and squad_id should be specified.
        /// If a character is invited with the squad_member role, wing_id and squad_id should either both be specified or not specified at all.
        /// If they aren’t specified, the invited character will join any squad with available positions.</param>
        /// <param name="wingId"></param>
        /// <param name="squadId"></param>
        /// <returns>IsSuccessful will be true on a successful call</returns>
        public ESIResponse <object> CreateFleetInvitation(string authToken, Int64 fleetId, int characterId, string role, Int64?wingId, Int64?squadId)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"fleets/{fleetId}/members/", authToken);

            request.AddJsonBody(new { character_id = characterId, role, wing_id = wingId, squad_id = squadId });

            return(_httpClient.Execute <object>(request));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Takes a source character ID in the url and a set of target character ID’s in the body, returns a CSPA charge cost
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="targetCharacters">The target characters to calculate the charge for</param>
        /// <returns>Aggregate cost of sending a mail from the source character to the target characters, in ISK</returns>
        public ESIResponse <float> Cspa(string authToken, int characterId, List <Int64> targetCharacters)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/cspa/", authToken);

            request.AddBody(targetCharacters);

            return(_client.Execute <float>(request));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Save a new fitting for a character
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="input">Details about the new fitting</param>
        /// <returns>Newly created fitting id</returns>
        public ESIResponse <CreateFittingResponse> CreateFitting(string authToken, int characterId, CreateFittingInput input)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/fittings/", authToken);

            request.AddBody(input);

            return(_client.Execute <CreateFittingResponse>(request));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Return locations for a set of item ids, which you can get from corporation assets endpoint. Coordinates for items in hangars or stations are set to (0,0,0
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <param name="itemIds">A list of item ids</param>
        /// <returns>List of asset locations</returns>
        public ESIResponse <List <GetCorporationAssetsLocationsResponse> > GetCorporationAssetsLocations(string authToken,
                                                                                                         int corporationId, Int64[] itemIds)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"corporations/{corporationId}/assets/locations/", authToken);

            request.AddBody(itemIds);

            return(_client.Execute <List <GetCorporationAssetsLocationsResponse> >(request));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Return names for a set of item ids, which you can get from character assets endpoint. Typically used for items that can customize names, like containers or ships.
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="itemIds">A list of item ids</param>
        /// <returns>List of asset names</returns>
        public ESIResponse <List <GetCharacterAssetsNamesResponse> > GetCharacterAssetsNames(string authToken,
                                                                                             int characterId, Int64[] itemIds)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/assets/names/", authToken);

            request.AddBody(itemIds);

            return(_client.Execute <List <GetCharacterAssetsNamesResponse> >(request));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Bulk add contacts with same settings
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="contactIds">A list of contacts to add</param>
        /// <param name="standing">Standing for the new contact</param>
        /// <param name="labelId">Add a custom label to the new contact</param>
        /// <param name="watched">Whether the new contact should be watched, note this is only effective on characters</param>
        /// <returns>A list of contact ids that successfully created</returns>
        public ESIResponse <List <Int64> > AddContacts(string authToken, int characterId, Int64[] contactIds, float standing, int?labelId, bool?watched)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/contacts/", authToken);

            request.AddParameter("standing", standing, ParameterType.QueryString);
            request.AddParameter("label_id", labelId, ParameterType.QueryString);
            request.AddParameter("watched", watched, ParameterType.QueryString);
            request.AddBody(contactIds);

            return(_client.Execute <List <Int64> >(request));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Delete a mail
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="mailId">An EVE mail ID</param>
        /// <returns>Mail deleted</returns>
        public ESIResponse <object> DeleteMail(string authToken, int characterId, int mailId)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"characters/{characterId}/mail/{mailId}/", authToken);

            return(_httpClient.Execute <object>(request));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Create a new squad in a fleet
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="fleetId">ID for a fleet</param>
        /// <param name="wingId">The wing_id to create squad in</param>
        /// <returns>Squad created</returns>
        public ESIResponse <CreateFleetSquadResponse> CreateFleetSquad(string authToken, Int64 fleetId, Int64 wingId)
        {
            var request = RestRequestHelper.CreateAuthorizedPostRequest($"fleets/{fleetId}/wings/{wingId}/squads/", authToken);

            return(_httpClient.Execute <CreateFleetSquadResponse>(request));
        }