示例#1
0
        /// <summary>
        /// Create new SIP domain
        /// </summary>
        /// <param name="accountSid">The account sid.</param>
        /// <param name="domainName">An address on Avaya CPaaS uniquely associated with your account and through which all your SIP traffic is routed.</param>
        /// <param name="friendlyName">A human-readable name associated with this domain.</param>
        /// <param name="voiceUrl">The URL requested when a call is received by your domain.</param>
        /// <param name="voiceMethod">The HTTP method used when requesting the VoiceUrl.</param>
        /// <param name="voiceFallbackUrl">The URL requested if the VoiceUrl fails.</param>
        /// <param name="voiceFallbackMethod">The HTTP method used when requesting the VoiceFallbackUrl.</param>
        /// <param name="hearbeatUrl">URL that can be requested every 60 seconds during the call to notify of elapsed time and pass other general information.</param>
        /// <param name="hearbeatMethod">Specifies the HTTP method used to request HeartbeatUrl.</param>
        /// <param name="voiceStatusCallback">The URL that Avaya CPaaS will use to send you status notifications regarding your SIP call.</param>
        /// <param name="voiceStatusCallbackMethod">The HTTP method used when requesting the VoiceStatusCallback.</param>
        /// <returns>Returns created domain</returns>
        public Domain CreateDomain(string accountSid, string domainName,
                                   string friendlyName        = null, string voiceUrl = null, HttpMethod voiceMethod = HttpMethod.POST,
                                   string voiceFallbackUrl    = null, HttpMethod voiceFallbackMethod       = HttpMethod.POST,
                                   string hearbeatUrl         = null, HttpMethod hearbeatMethod            = HttpMethod.POST,
                                   string voiceStatusCallback = null, HttpMethod voiceStatusCallbackMethod = HttpMethod.POST)
        {
            // Get client to make request
            var client = HttpProvider.GetHttpClient();

            // Create POST request
            var request = RestRequestHelper.CreateRestRequest(Method.POST, $"Accounts/{accountSid}/SIP/Domains.json");

            // Mark obligatory parameters
            Require.Argument("DomainName", domainName);

            // Add CreateDomain query and body parameters
            request.AddParameter("DomainName", domainName);

            this.SetParamsForCreateOrUpdateDomain(request, friendlyName, voiceUrl, voiceMethod, voiceFallbackUrl,
                                                  voiceFallbackMethod, hearbeatUrl,
                                                  hearbeatMethod, voiceStatusCallback, voiceStatusCallbackMethod);

            // Send request
            var response = client.Execute(request);

            return(this.ReturnOrThrowException <Domain>(response));
        }
        /// <summary>
        /// Get the icon urls for a corporation
        /// </summary>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>Urls for icons for the given corporation id and server</returns>
        public ESIResponse <GetCorporationIconResponse> GetCorporationIcon(int corporationId)
        {
            var request = RestRequestHelper.CreateGetRequest($"corporations/{corporationId}/icons/",
                                                             Method.GET);

            return(_client.Execute <GetCorporationIconResponse>(request));
        }
示例#3
0
        public JobOut getJobById(int jobId)
        {
            File.AppendAllText(string.Format("{0}\\Validation_{1}.txt", pathLog, DateTime.Now.ToString("yyyyMMdd")), string.Format("**** Método: getJobById. JobId: {0}. Data: {1} ****", jobId, DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")) + Environment.NewLine);

            JobOut jobOut = new JobOut();

            try
            {
                RestClient client = new RestClient(WebConfigurationManager.AppSettings["API.URL"].ToString() + string.Format(WebConfigurationManager.AppSettings["API.GetJobById"].ToString(), jobId));

                RestRequest request = RestRequestHelper.Get(Method.GET);

                client.Timeout          = (1000 * 60 * 60);
                client.ReadWriteTimeout = (1000 * 60 * 60);

                IRestResponse response = client.Execute(request);

                jobOut = SimpleJson.DeserializeObject <JobOut>(response.Content);

                if (!jobOut.success)
                {
                    throw new Exception(jobOut.messages.FirstOrDefault());
                }
            }
            catch (Exception ex)
            {
                File.AppendAllText(string.Format("{0}\\Error_{1}.txt", pathLog, DateTime.Now.ToString("yyyyMMdd")), string.Format("**** Método: getJobById. Erro: {0}. JobId: {1}. Data: {2} ****", ex.Message, jobId, DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")) + Environment.NewLine);

                jobOut.successMessage = null;
                jobOut.messages.Add(ex.Message);
            }

            return(jobOut);
        }
示例#4
0
        /// <summary>
        /// Updates an incoming phone number data
        /// </summary>
        /// <param name="accountSid">The account sid.</param>
        /// <param name="incomingPhoneNumberSid">34 characters long unique incoming phone number identifier</param>
        /// <param name="friendlyName">User generated name for the incoming number.</param>
        /// <param name="voiceUrl">The URL returning InboundXML incoming calls should execute when connected.</param>
        /// <param name="voiceMethod">Specifies the HTTP method used to request the VoiceUrl once incoming call connects.</param>
        /// <param name="voiceFallbackUrl">URL used if any errors occur during execution of InboundXML on a call or at initial request of the VoiceUrl.</param>
        /// <param name="voiceFallbackMethod">Specifies the HTTP method used to request the VoiceFallbackUrl once incoming call connects.</param>
        /// <param name="voiceCallerIdLookup">Look up the caller’s caller-ID name from the CNAM database(additional charges apply).</param>
        /// <param name="smsUrl">The URL returning InboundXML incoming phone numbers should execute when receiving an SMS.</param>
        /// <param name="smsMethod">Specifies the HTTP method used to request the SmsUrl once an incoming SMS is received.</param>
        /// <param name="smsFallbackUrl">URL used if any errors occur during execution of InboundXML from an SMS or at initial request of the SmsUrl.</param>
        /// <param name="smsFallbackMethod">Specifies the HTTP method used to request the SmsFallbackUrl.</param>
        /// <param name="heartbeatUrl">URL that can be used to monitor the phone number.</param>
        /// <param name="heartbeatMethod">The HTTP method Avaya CPaaS will use when requesting the HeartbeatURL.</param>
        /// <param name="statusCallback">URL that can be requested to receive notification when and how incoming call has ended.</param>
        /// <param name="statusCallbackMethod">The HTTP method Avaya CPaaS will use when requesting the HangupCallback URL.</param>
        /// <param name="hangupCallback">This is a StatusCallback clone that will be phased out in future versions.</param>
        /// <param name="hangupCallbackMethod">This is a StatusCallbackMethod clone that will be phased out in future versions.</param>
        /// <returns>Returns updated incoming number</returns>
        public IncomingPhoneNumber UpdateIncomingNumber(string accountSid, string incomingPhoneNumberSid,
                                                        string friendlyName            = null, string voiceUrl = null,
                                                        HttpMethod voiceMethod         = HttpMethod.POST, string voiceFallbackUrl  = null,
                                                        HttpMethod voiceFallbackMethod = HttpMethod.POST, bool voiceCallerIdLookup = false, string smsUrl = null,
                                                        HttpMethod smsMethod           = HttpMethod.POST, string smsFallbackUrl = null,
                                                        HttpMethod smsFallbackMethod   = HttpMethod.POST, string heartbeatUrl   = null,
                                                        HttpMethod heartbeatMethod     = HttpMethod.POST,
                                                        string statusCallback          = null, HttpMethod statusCallbackMethod = HttpMethod.POST,
                                                        string hangupCallback          = null, HttpMethod hangupCallbackMethod = HttpMethod.POST)
        {
            // Get client to make request
            var client = HttpProvider.GetHttpClient();

            // Create POST request
            var request = RestRequestHelper.CreateRestRequest(Method.POST,
                                                              $"Accounts/{accountSid}/IncomingPhoneNumbers/{incomingPhoneNumberSid}.json");

            // Add UpdateIncomingNumber query and body parameters
            this.SetParamsForUpdatingIncomingNumber(request, friendlyName, voiceUrl, voiceMethod, voiceFallbackUrl,
                                                    voiceFallbackMethod, voiceCallerIdLookup, smsUrl, smsMethod,
                                                    smsFallbackUrl, smsFallbackMethod, heartbeatUrl, heartbeatMethod, statusCallback, statusCallbackMethod,
                                                    hangupCallback, hangupCallbackMethod);

            // Send request
            var response = client.Execute(request);

            return(this.ReturnOrThrowException <IncomingPhoneNumber>(response));
        }
示例#5
0
        /// <summary>
        /// Get all invited attendees for a given event
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="characterId">An EVE character ID</param>
        /// <param name="eventId">The id of the event requested</param>
        /// <returns>List of attendees</returns>
        public ESIResponse <List <GetEventAttendeesResponse> > GetEventAttendees(string authToken, int characterId, Int64 eventId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"characters/{characterId}/calendar/{eventId}/attendees/",
                                                                       authToken);

            return(_client.Execute <List <GetEventAttendeesResponse> >(request));
        }
        /// <summary>
        /// Authorizes previously blocked destination for outbound calls and sms messages
        /// </summary>
        /// <param name="accountSid">The account sid.</param>
        /// <param name="countryCode">Country code.</param>
        /// <param name="mobileEnabled">Mobile status for the destination. If false, all mobile call activity will be rejected or disabled. Allowed values are "true" and "false".</param>
        /// <param name="landlineEnabled">Landline status for the destination. If false, all landline call activity will be rejected or disabled. Allowed values are "true" and "false".</param>
        /// <param name="smsEnabled">SMS status for the destination. If false, all SMS activity will be rejected or disabled. Allowed values are "true" and "false".</param>
        /// <returns>Returns fraud control rule</returns>
        public FraudControlRule AuthorizeDestination(string accountSid, string countryCode,
                                                     bool mobileEnabled = true, bool landlineEnabled = true, bool smsEnabled = true)
        {
            // Get client to make request
            var client = HttpProvider.GetHttpClient();

            // Create POST request
            var request = RestRequestHelper.CreateRestRequest(Method.POST,
                                                              $"Accounts/{accountSid}/Fraud/Authorize/{countryCode}.json");

            // Add AuthorizeDestination query and body parameters
            this.SetParamsForBlockOrAuthorizeDestination(request, mobileEnabled, landlineEnabled, smsEnabled);

            // Send request
            var response = client.Execute(request);

            var fraudControlRuleElement = this.ReturnOrThrowException <FraudControlRuleElement>(response);

            // If authorized part of a fraud control rule element is null return null
            if (fraudControlRuleElement.Authorized == null)
            {
                return(null);
            }

            // Get authorized part of fraud control rule element and set type
            var fraudControlRuleAuthorized = fraudControlRuleElement.Authorized;

            fraudControlRuleAuthorized.Type = FraudControlType.AUTHORIZED;

            return(fraudControlRuleAuthorized);
        }
        /// <summary>
        /// Extends a destinations authorization expiration by 30 days
        /// </summary>
        /// <param name="accountSid">The account sid.</param>
        /// <param name="countryCode">Country code.</param>
        /// <returns>Returns fraud contorl rule</returns>
        public FraudControlRule ExtendDestinationAuthorization(string accountSid, string countryCode)
        {
            // Get client to make request
            var client = HttpProvider.GetHttpClient();

            // Create POST request
            var request = RestRequestHelper.CreateRestRequest(Method.POST,
                                                              $"Accounts/{accountSid}/Fraud/Extend/{countryCode}.json");

            // Send request
            var response = client.Execute(request);

            var fraudControlRuleElement = this.ReturnOrThrowException <FraudControlRuleElement>(response);

            // If authorized part of a fraud control rule element is null return null
            if (fraudControlRuleElement.Authorized == null)
            {
                return(null);
            }

            // Get authorized part of fraud control rule element and set type
            var fraudControlRuleAuthorized = fraudControlRuleElement.Authorized;

            fraudControlRuleAuthorized.Type = FraudControlType.AUTHORIZED;

            return(fraudControlRuleAuthorized);
        }
        /// <summary>
        /// Return a corporation’s member limit, not including CEO himself
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>The corporation’s member limit</returns>
        public ESIResponse <int> GetCorporationMemberLimit(string authToken, int corporationId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/members/limit/",
                                                                       authToken);

            return(_client.Execute <int>(request));
        }
        /// <summary>
        /// Records a call
        /// </summary>
        /// <param name="accountSid">The account sid.</param>
        /// <param name="callSid">Call SID.</param>
        /// <param name="record">Specifies if a call recording should start or end. Allowed values are "true" to start recording and "false" to end recording. Any number of simultaneous, separate recordings can be initiated.</param>
        /// <param name="direction">Specifies which audio stream to record. Allowed values are "in" to record the incoming caller's audio, "out" to record the outgoing caller's audio, and "both" to record both.</param>
        /// <param name="timeLimit">The maximum duration of the recording.Allowed value is an integer greater than 0.</param>
        /// <param name="callbackUrl">A URL that will be requested when the recording ends, sending information about the recording. The longer the recording, the longer the delay in processing the recording and requesting the CallbackUrl. Url length is limited to 200 characters.</param>
        /// <param name="fileFormat">Specifies the file format of the recording. Allowed values are "mp3" or "wav" - any other value will default to "mp3".</param>
        /// <param name="trimSilence">Trims all silence from the beginning of the recording. Allowed values are "true" or "false" - any other value will default to "false".</param>
        /// <param name="transcribe">Specifies if this recording should be transcribed. Allowed values are "true" and "false" - all other values will default to "false".</param>
        /// <param name="transcribeQuality">Specifies the quality of the transcription. Allowed values are "auto" for automated transcriptions and "hybrid" for human-reviewed transcriptions - all other values will default to "auto".</param>
        /// <param name="transcribeCallback">A URL that will be requested when the call ends, sending information about the transcription. The longer the recording, the longer the delay in processing the transcription and requesting the TranscribeCallback. URL length is limited to 200 characters.</param>
        /// <returns>Returns created recording</returns>
        public Recording RecordCall(string accountSid, string callSid, bool record,
                                    RecordingAudioDirection direction = RecordingAudioDirection.BOTH, int?timeLimit = null,
                                    string callbackUrl = null, RecordingFileFormat fileFormat = RecordingFileFormat.MP3,
                                    bool trimSilence   = false, bool transcribe = false,
                                    TranscribeQuality transcribeQuality = TranscribeQuality.AUTO,
                                    string transcribeCallback           = null)
        {
            // Get client to make request
            var client = HttpProvider.GetHttpClient();

            // Create POST request
            var request = RestRequestHelper.CreateRestRequest(Method.POST,
                                                              $"Accounts/{accountSid}/Calls/{callSid}/Recordings.json");

            // Mark obligatory parameters
            Require.Argument("Record", record);

            // Add RecordCall query and body parameters
            this.SetParamsForRecordCall(request, record, direction, timeLimit, callbackUrl, fileFormat, trimSilence,
                                        transcribe, transcribeQuality, transcribeCallback);

            // Send request
            var response = client.Execute(request);

            return(this.ReturnOrThrowException <Recording>(response));
        }
示例#10
0
        public void TestDeleteEndPoint()
        {
            int    id       = random.Next(100);
            string jsonData = "{" +
                              "\"BrandName\": \"AnimalWare\"," +
                              "\"Features\": {" +
                              "\"Feature\": [" +
                              "\"8th Generation Intel® Core™ i5-8300H\"," +
                              "\"Windows 10 Home 64-bit English\"," +
                              "\"NVIDIA® GeForce® GTX 1660 Ti 6GB GDDR6\"," +
                              "\"8GB, 2x4GB, DDR4, 2666MHz\"" +
                              "]" +
                              "}," +
                              "\"Id\":" + id + "," +
                              "\"LaptopName\": \"LionWare M17\"" +
                              "}";

            Dictionary <string, string> requestHeaders = new Dictionary <string, string>()
            {
                { "Accept", "application/json" },
                { "Content-Type", "application/json" }
            };
            IRestResponse <Laptop> postResponse = RestRequestHelper.PerformPostRequest <Laptop>(postUrl, requestHeaders, jsonData, DataFormat.Json);

            IRestResponse <Laptop> getResponseBeforeDelete = RestRequestHelper.PerformGetRequest <Laptop>(getUrl + id, requestHeaders);

            Console.WriteLine("Brandname =>" + getResponseBeforeDelete.Data.BrandName);
            requestHeaders["Accept"] = "*/*"; //This Header is needed to receive the response from Delete request.
            IRestResponse deleteResponse = RestRequestHelper.PerformDeleteRequest(deleteUrl + id, requestHeaders);

            Assert.AreEqual(200, (int)deleteResponse.StatusCode);
            deleteResponse = RestRequestHelper.PerformDeleteRequest(deleteUrl + id, requestHeaders);
            Assert.AreEqual(404, (int)deleteResponse.StatusCode);
        }
示例#11
0
        /// <summary>
        /// List all active player alliances
        /// </summary>
        /// <returns>List of Alliance IDs</returns>
        public ESIResponse <List <Int64> > Alliances()
        {
            var request  = RestRequestHelper.CreateGetRequest("alliances/", Method.GET);
            var response = _client.Execute <List <Int64> >(request);

            return(response);
        }
        public void PostEndPointusingXmlData()
        {
            int    id      = random.Next(1000);
            string xmlData = "<Laptop>" +
                             "<BrandName>Alienware</BrandName>" +
                             "<Features>" +
                             "<Feature> 8th Generation Intel® Core™ i5 - 8300H </Feature>" +
                             "<Feature> Windows 10 Home 64 - bit English </Feature>" +
                             "<Feature> NVIDIA® GeForce® GTX 1660 Ti 6GB GDDR6</Feature>" +
                             "<Feature> 8GB, 2x4GB, DDR4, 2666MHz </Feature>" +
                             " </Features>" +
                             "<Id>" + id + "</Id>" +
                             "<LaptopName> Alienware M17 </LaptopName>" +
                             "</Laptop>";
            Dictionary <string, string> requestHeaders = new Dictionary <string, string>()
            {
                { "Accept", "application/xml" },
                { "Content-Type", "application/xml" }
            };
            IRestResponse <Laptop> restResponse = RestRequestHelper.PerformPostRequest <Laptop>(postUrl, requestHeaders, xmlData, DataFormat.Xml);

            // if (restResponse.IsSuccessful)
            {
                Console.WriteLine((int)restResponse.StatusCode);
                Console.WriteLine(restResponse.Content);
                Assert.AreEqual(200, (int)restResponse.StatusCode);
                Assert.AreEqual("AlienWare", restResponse.Data.BrandName);
            }
        }
示例#13
0
        /// <summary>
        /// Get the icon urls for a alliance
        /// </summary>
        /// <param name="allianceId">An EVE alliance ID</param>
        /// <returns>Icon URLs for the given alliance id and server</returns>
        public ESIResponse <GetAllianceIconsResponse> GetAllianceIcons(Int64 allianceId)
        {
            var request = RestRequestHelper.CreateGetRequest($"alliances/{allianceId}/icons/", Method.GET);

            var response = _client.Execute <GetAllianceIconsResponse>(request);

            return(response);
        }
示例#14
0
        /// <summary>
        /// List all current member corporations of an alliance
        /// </summary>
        /// <param name="allianceId">An EVE alliance ID</param>
        /// <returns>List of corporation IDs</returns>
        public ESIResponse <List <Int64> > GetAllianceCorporations(Int64 allianceId)
        {
            var request = RestRequestHelper.CreateGetRequest($"alliances/{allianceId}/corporations/", Method.GET);

            var response = _client.Execute <List <Int64> >(request);

            return(response);
        }
示例#15
0
        /// <summary>
        /// Bulk delete contacts
        /// </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 delete</param>
        /// <returns>IsSuccessful will be true on successfull call</returns>
        public ESIResponse <object> DeleteCharacterContacts(string authToken, int characterId, Int64[] contactIds)
        {
            var request = RestRequestHelper.CreateAuthorizedDeleteRequest($"characters/{characterId}/contacts/", authToken);

            request.AddParameter("contact_ids", contactIds, ParameterType.QueryString);

            return(_client.Execute <object>(request));
        }
示例#16
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));
        }
        /// <summary>
        /// Get details about a given outpost.
        /// <remarks>
        /// Note: This endpoint will be removed once outposts are migrated to Citadels as talked about in this blog:
        /// https://community.eveonline.com/news/dev-blogs/the-next-steps-in-structure-transition/
        /// </remarks>
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <param name="outpostId">A station (outpost) ID</param>
        /// <returns>Details about the given outpost</returns>
        public ESIResponse <GetCorporationOutpostDetailResponse> GetCorporationOutpostDetail(string authToken,
                                                                                             int corporationId, Int64 outpostId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/outposts/{outpostId}/",
                                                                       authToken);

            return(_client.Execute <GetCorporationOutpostDetailResponse>(request));
        }
示例#18
0
        /// <summary>
        /// Update metadata about 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>
        /// <param name="read">Whether the mail is flagged as read</param>
        /// <param name="labels">Labels to assign to the mail. Pre-existing labels are unassigned</param>
        /// <returns>Mail updated</returns>
        public ESIResponse <object> UpdateMail(string authToken, int characterId, int mailId, bool?read, List <long> labels)
        {
            var request = RestRequestHelper.CreateAuthorizedPutRequest($"characters/{characterId}/mail/{mailId}/", authToken);

            request.AddJsonBody(new { read, labels });

            return(_httpClient.Execute <object>(request));
        }
示例#19
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));
        }
示例#20
0
        /// <summary>
        /// Resolve a set of character IDs to character names
        /// </summary>
        /// <param name="characterIds">list of character IDs</param>
        /// <returns>List of id/name associations</returns>
        public ESIResponse <List <GetCharacterNamesResponse> > GetCharacterNames(Int64[] characterIds)
        {
            var request = RestRequestHelper.CreateGetRequest($"characters/names/");

            request.AddQueryParameter("character_ids", string.Join(",", characterIds));

            return(_client.Execute <List <GetCharacterNamesResponse> >(request));
        }
示例#21
0
        /// <summary>
        /// Bulk lookup of character IDs to corporation, alliance and faction
        /// </summary>
        /// <param name="characterIds">The character IDs to fetch affiliations for. All characters must exist, or none will be returned.</param>
        /// <returns>Character corporation, alliance and faction IDs</returns>
        public ESIResponse <List <GetcharacterAffiliationsResponse> > GetcharacterAffiliations(Int64[] characterIds)
        {
            var request = RestRequestHelper.CreatePostRequest($"characters/affiliation/");

            request.AddBody(characterIds);

            return(_client.Execute <List <GetcharacterAffiliationsResponse> >(request));
        }
        /// <summary>
        /// Return corporation hangar and wallet division names, only show if a division is not using the default name
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>List of corporation division names</returns>
        public ESIResponse <GetCorporationDivisionsResponse> GetCorporationDivisions(string authToken,
                                                                                     int corporationId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/divisions/",
                                                                       authToken);

            return(_client.Execute <GetCorporationDivisionsResponse>(request));
        }
        /// <summary>
        /// Resolve a set of corporation IDs to corporation names
        /// </summary>
        /// <param name="corporationIds">corporation IDs to resolve</param>
        /// <returns>List of id/name associations</returns>
        public ESIResponse <List <GetCorporationNamesResponse> > GetCorporationNames(Int64[] corporationIds)
        {
            var request = RestRequestHelper.CreateGetRequest($"corporations/names/", Method.GET);

            request.AddParameter("corporation_ids", string.Join(",", corporationIds), ParameterType.QueryString);

            return(_client.Execute <List <GetCorporationNamesResponse> >(request));
        }
        /// <summary>
        /// Return how roles have changed for a coporation’s members, up to a month
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>List of role changes</returns>
        public ESIResponse <List <GetCorporationMemberRolesHistoryResponse> > GetCorporationMemberRolesHistory(string authToken,
                                                                                                               int corporationId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/roles/history/",
                                                                       authToken);

            return(_client.Execute <List <GetCorporationMemberRolesHistoryResponse> >(request));
        }
示例#25
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));
        }
示例#26
0
        /// <summary>
        /// Rename a fleet wing
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="fleetId">ID for a fleet</param>
        /// <param name="wingId">The wing to delete</param>
        /// <param name="name">New wing name</param>
        /// <returns>IsSuccessful will be true on a successful call</returns>
        public ESIResponse <object> RenameFleetWing(string authToken, Int64 fleetId, Int64 wingId, string name)
        {
            var request = RestRequestHelper.CreateAuthorizedPutRequest($"fleets/{fleetId}/wings/{wingId}/", authToken);

            request.AddJsonBody(new { name });

            return(_httpClient.Execute <object>(request));
        }
示例#27
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));
        }
示例#28
0
        /// <summary>
        /// Update settings about a fleet
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="fleetId">ID for a fleet</param>
        /// <param name="motd">New fleet MOTD in CCP flavoured HTML</param>
        /// <param name="isFreeMove">Should free-move be enabled in the fleet</param>
        /// <returns>IsSuccessful will be true on a successful call</returns>
        public ESIResponse <object> UpdateFleet(string authToken, Int64 fleetId, string motd, bool?isFreeMove)
        {
            var request = RestRequestHelper.CreateAuthorizedPutRequest($"fleets/{fleetId}/", authToken);

            request.AddJsonBody(new { motd, is_free_move = isFreeMove });

            return(_httpClient.Execute <object>(request));
        }
        /// <summary>
        /// Return a corporation’s facilities
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>List of corporation facilities</returns>
        public ESIResponse <List <GetCorporationFacilitiesResponse> > GetCorpotaionFacilities(string authToken,
                                                                                              int corporationId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/facilities/",
                                                                       authToken);

            return(_client.Execute <List <GetCorporationFacilitiesResponse> >(request));
        }
        /// <summary>
        /// Returns additional information about a corporation’s members which helps tracking their activities
        /// </summary>
        /// <param name="authToken">Access token to use</param>
        /// <param name="corporationId">An EVE corporation ID</param>
        /// <returns>List of member character IDs</returns>
        public ESIResponse <List <GetCorporationMemberTracking> > GetCorporationMemberTracking(string authToken,
                                                                                               int corporationId)
        {
            var request = RestRequestHelper.CreateAuthorizedGetRequest($"corporations/{corporationId}/membertracking/",
                                                                       authToken);

            return(_client.Execute <List <GetCorporationMemberTracking> >(request));
        }