idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
13,300 | public ArrayList < Date > billingAccount_historyTollfreeConsumption_GET ( String billingAccount ) throws IOException { String qPath = "/telephony/{billingAccount}/historyTollfreeConsumption" ; StringBuilder sb = path ( qPath , billingAccount ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; } | Previous tollfree bill |
13,301 | public OvhConferenceWebAccess billingAccount_conference_serviceName_webAccess_POST ( String billingAccount , String serviceName , OvhConferenceWebAccessTypeEnum type ) throws IOException { String qPath = "/telephony/{billingAccount}/conference/{serviceName}/webAccess" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "type" , type ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhConferenceWebAccess . class ) ; } | Add a public web access to your conference |
13,302 | public ArrayList < OvhPhone > billingAccount_oldPhone_GET ( String billingAccount ) throws IOException { String qPath = "/telephony/{billingAccount}/oldPhone" ; StringBuilder sb = path ( qPath , billingAccount ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t16 ) ; } | List old phones archived as they were not returned after an RMA |
13,303 | public void billingAccount_billingAccountSite_POST ( String billingAccount , String billingAccountSite ) throws IOException { String qPath = "/telephony/{billingAccount}/billingAccountSite" ; StringBuilder sb = path ( qPath , billingAccount ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "billingAccountSite" , billingAccountSite ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Used to overwrite current billing account feature by the billing account site |
13,304 | public ArrayList < OvhPrice > billingAccount_allowedCreditThreshold_GET ( String billingAccount ) throws IOException { String qPath = "/telephony/{billingAccount}/allowedCreditThreshold" ; StringBuilder sb = path ( qPath , billingAccount ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t17 ) ; } | Get the allowed creditThreshold for this billing account |
13,305 | public void billingAccount_screen_serviceName_screenLists_POST ( String billingAccount , String serviceName , String callNumber , OvhScreenListNatureEnum nature , OvhScreenListTypeEnum type ) throws IOException { String qPath = "/telephony/{billingAccount}/screen/{serviceName}/screenLists" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "callNumber" , callNumber ) ; addBody ( o , "nature" , nature ) ; addBody ( o , "type" , type ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Create a new screen list rule |
13,306 | public OvhOfferTask billingAccount_number_serviceName_convertToLine_POST ( String billingAccount , String serviceName , String offer ) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}/convertToLine" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "offer" , offer ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOfferTask . class ) ; } | Schedule a conversion to line |
13,307 | public OvhTask billingAccount_number_serviceName_changeFeatureType_POST ( String billingAccount , String serviceName , OvhTypeEnum featureType ) throws IOException { String qPath = "/telephony/{billingAccount}/number/{serviceName}/changeFeatureType" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "featureType" , featureType ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; } | Change the feature type of the phone number |
13,308 | public OvhTimeCondition billingAccount_timeCondition_serviceName_condition_POST ( String billingAccount , String serviceName , OvhTimeConditionsDayEnum day , String hourBegin , String hourEnd , OvhTimeConditionsPolicyEnum policy ) throws IOException { String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "day" , day ) ; addBody ( o , "hourBegin" , hourBegin ) ; addBody ( o , "hourEnd" , hourEnd ) ; addBody ( o , "policy" , policy ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTimeCondition . class ) ; } | Create a new time condition rule |
13,309 | public void billingAccount_timeCondition_serviceName_condition_id_DELETE ( String billingAccount , String serviceName , Long id ) throws IOException { String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition/{id}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , id ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; } | Delete the given screen list |
13,310 | public OvhDetailedRateCodeInformation billingAccount_rsva_serviceName_scheduleRateCode_POST ( String billingAccount , String serviceName , String rateCode ) throws IOException { String qPath = "/telephony/{billingAccount}/rsva/{serviceName}/scheduleRateCode" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "rateCode" , rateCode ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhDetailedRateCodeInformation . class ) ; } | Schedule a new rate code for this sva |
13,311 | public ArrayList < OvhRateCodeInformation > billingAccount_rsva_serviceName_allowedRateCodes_GET ( String billingAccount , String serviceName ) throws IOException { String qPath = "/telephony/{billingAccount}/rsva/{serviceName}/allowedRateCodes" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t18 ) ; } | Compatible rate codes related to this value added service |
13,312 | public OvhOvhPabxCustomStatus billingAccount_ovhPabx_serviceName_hunting_customStatus_POST ( String billingAccount , String serviceName , String color , String description , String name ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/customStatus" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "color" , color ) ; addBody ( o , "description" , description ) ; addBody ( o , "name" , name ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxCustomStatus . class ) ; } | Create a new custom status |
13,313 | public OvhOvhPabxDialplanExtensionConditionTime billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST ( String billingAccount , String serviceName , Long dialplanId , Long extensionId , Date timeFrom , Date timeTo , OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/conditionTime" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , dialplanId , extensionId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "timeFrom" , timeFrom ) ; addBody ( o , "timeTo" , timeTo ) ; addBody ( o , "weekDay" , weekDay ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxDialplanExtensionConditionTime . class ) ; } | Create a new time condition for an extension |
13,314 | public OvhOvhPabxDialplanExtensionRule billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_POST ( String billingAccount , String serviceName , Long dialplanId , Long extensionId , OvhOvhPabxDialplanExtensionRuleActionEnum action , String actionParam , Boolean negativeAction , Long position ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/rule" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , dialplanId , extensionId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; addBody ( o , "actionParam" , actionParam ) ; addBody ( o , "negativeAction" , negativeAction ) ; addBody ( o , "position" , position ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxDialplanExtensionRule . class ) ; } | Create a new rule for an extension |
13,315 | public OvhOvhPabxDialplanExtension billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_POST ( String billingAccount , String serviceName , Long dialplanId , Boolean enable , Long position , OvhSchedulerCategoryEnum schedulerCategory , OvhOvhPabxDialplanExtensionConditionScreenListTypeEnum screenListType ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , dialplanId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "enable" , enable ) ; addBody ( o , "position" , position ) ; addBody ( o , "schedulerCategory" , schedulerCategory ) ; addBody ( o , "screenListType" , screenListType ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxDialplanExtension . class ) ; } | Create a new extension for a dialplan |
13,316 | public void billingAccount_ovhPabx_serviceName_dialplan_dialplanId_DELETE ( String billingAccount , String serviceName , Long dialplanId ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , dialplanId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; } | Delete the given dialplan |
13,317 | public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_POST ( String billingAccount , String serviceName , Boolean anonymousRejection , String name , OvhOvhPabxDialplanNumberPresentationEnum showCallerNumber , Long transferTimeout ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "anonymousRejection" , anonymousRejection ) ; addBody ( o , "name" , name ) ; addBody ( o , "showCallerNumber" , showCallerNumber ) ; addBody ( o , "transferTimeout" , transferTimeout ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxDialplan . class ) ; } | Create a new dialplan |
13,318 | public OvhOvhPabxMenuEntry billingAccount_ovhPabx_serviceName_menu_menuId_entry_POST ( String billingAccount , String serviceName , Long menuId , OvhOvhPabxIvrMenuEntryActionEnum action , String actionParam , String dtmf , Long position ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , menuId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; addBody ( o , "actionParam" , actionParam ) ; addBody ( o , "dtmf" , dtmf ) ; addBody ( o , "position" , position ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxMenuEntry . class ) ; } | Create a new menu entry |
13,319 | public void billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_DELETE ( String billingAccount , String serviceName , Long menuId , Long entryId ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , menuId , entryId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; } | Delete the given menu entry |
13,320 | public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_POST ( String billingAccount , String serviceName , Long greetSound , Long greetSoundTts , Long invalidSound , Long invalidSoundTts , String name ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "greetSound" , greetSound ) ; addBody ( o , "greetSoundTts" , greetSoundTts ) ; addBody ( o , "invalidSound" , invalidSound ) ; addBody ( o , "invalidSoundTts" , invalidSoundTts ) ; addBody ( o , "name" , name ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxMenu . class ) ; } | Create a new menu |
13,321 | public void billingAccount_ovhPabx_serviceName_tts_POST ( String billingAccount , String serviceName , String text , OvhOvhPabxTtsVoiceEnum voice ) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/tts" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "text" , text ) ; addBody ( o , "voice" , voice ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Create a new text to speech |
13,322 | public Long billingAccount_voicemail_serviceName_greetings_POST ( String billingAccount , String serviceName , OvhVoicemailMessageFolderGreetingEnum dir , String documentId ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/greetings" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "dir" , dir ) ; addBody ( o , "documentId" , documentId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , Long . class ) ; } | Upload a new sound for a specific greeting . Return a task id . |
13,323 | public void billingAccount_voicemail_serviceName_migrateOnNewVersion_POST ( String billingAccount , String serviceName ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/migrateOnNewVersion" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; exec ( qPath , "POST" , sb . toString ( ) , null ) ; } | Change the voicemail on a new version to manager greetings directories and extra settings . |
13,324 | public ArrayList < Long > billingAccount_voicemail_serviceName_directories_GET ( String billingAccount , String serviceName , OvhVoicemailMessageFolderDirectoryEnum dir ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; query ( sb , "dir" , dir ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; } | Voicemail directory messages |
13,325 | public void billingAccount_voicemail_serviceName_directories_id_move_POST ( String billingAccount , String serviceName , Long id , OvhVoicemailMessageFolderDirectoryEnum dir ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}/move" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , id ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "dir" , dir ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Move the message to another directory |
13,326 | public OvhPcsFile billingAccount_voicemail_serviceName_directories_id_download_GET ( String billingAccount , String serviceName , Long id , OvhServiceVoicemailAudioFormatEnum format ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}/download" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , id ) ; query ( sb , "format" , format ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhPcsFile . class ) ; } | Get a url to download the sound file |
13,327 | public void billingAccount_voicemail_serviceName_settings_changePassword_POST ( String billingAccount , String serviceName , String password ) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/settings/changePassword" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "password" , password ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Change the voicemail password . It must be 4 digit |
13,328 | public OvhTrunkExternalDisplayedNumber billingAccount_trunk_serviceName_externalDisplayedNumber_POST ( String billingAccount , String serviceName , Boolean autoValidation , String number ) throws IOException { String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "autoValidation" , autoValidation ) ; addBody ( o , "number" , number ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTrunkExternalDisplayedNumber . class ) ; } | External displayed number creation for a given trunk |
13,329 | public void billingAccount_trunk_serviceName_externalDisplayedNumber_number_DELETE ( String billingAccount , String serviceName , String number ) throws IOException { String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , number ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; } | Delete an external displayed number for a given trunk |
13,330 | public OvhTrunkExternalDisplayedNumberValidation billingAccount_trunk_serviceName_externalDisplayedNumber_number_validate_POST ( String billingAccount , String serviceName , String number ) throws IOException { String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}/validate" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , number ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhTrunkExternalDisplayedNumberValidation . class ) ; } | Generate a phone call for validation . Returned validation code should be typed when asked . |
13,331 | public void billingAccount_transferSecurityDeposit_POST ( String billingAccount , Long amount , String billingAccountDestination ) throws IOException { String qPath = "/telephony/{billingAccount}/transferSecurityDeposit" ; StringBuilder sb = path ( qPath , billingAccount ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "amount" , amount ) ; addBody ( o , "billingAccountDestination" , billingAccountDestination ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Transfer security deposit between two billing accounts |
13,332 | public ArrayList < Long > billingAccount_offerTask_GET ( String billingAccount , OvhOfferTaskActionEnum action , OvhTaskStatusEnum status , OvhOfferTaskTypeEnum type ) throws IOException { String qPath = "/telephony/{billingAccount}/offerTask" ; StringBuilder sb = path ( qPath , billingAccount ) ; query ( sb , "action" , action ) ; query ( sb , "status" , status ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; } | Operations on a telephony service s offer |
13,333 | public OvhConsumptionThreshold billingAccount_outplanNotification_POST ( String billingAccount , OvhOutplanNotificationBlockEnum block , String notifyEmail , Double percentage ) throws IOException { String qPath = "/telephony/{billingAccount}/outplanNotification" ; StringBuilder sb = path ( qPath , billingAccount ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "block" , block ) ; addBody ( o , "notifyEmail" , notifyEmail ) ; addBody ( o , "percentage" , percentage ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhConsumptionThreshold . class ) ; } | Add an outplan notification on the billing account |
13,334 | public OvhHistoryRepaymentConsumption billingAccount_historyRepaymentConsumption_POST ( String billingAccount , String billingNumber ) throws IOException { String qPath = "/telephony/{billingAccount}/historyRepaymentConsumption" ; StringBuilder sb = path ( qPath , billingAccount ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "billingNumber" , billingNumber ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhHistoryRepaymentConsumption . class ) ; } | Ask for a new repayment |
13,335 | public OvhTask billingAccount_ddi_serviceName_changeDestination_POST ( String billingAccount , String serviceName , String destination ) throws IOException { String qPath = "/telephony/{billingAccount}/ddi/{serviceName}/changeDestination" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "destination" , destination ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; } | Change the destination of the DDI |
13,336 | public ArrayList < OvhAccessoryOffer > accessories_GET ( OvhNumberCountryEnum country ) throws IOException { String qPath = "/telephony/accessories" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t19 ) ; } | Get all available accessories |
13,337 | public ArrayList < OvhTelephonySearchService > searchServices_GET ( String axiom ) throws IOException { String qPath = "/telephony/searchServices" ; StringBuilder sb = path ( qPath ) ; query ( sb , "axiom" , axiom ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t20 ) ; } | Search a service with its domain to get its billing account and type |
13,338 | public ArrayList < OvhNumberDetailedZone > number_detailedZones_GET ( String axiom , OvhNumberCountryEnum country ) throws IOException { String qPath = "/telephony/number/detailedZones" ; StringBuilder sb = path ( qPath ) ; query ( sb , "axiom" , axiom ) ; query ( sb , "country" , country ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t21 ) ; } | Get all available geographic zone with some details from a country |
13,339 | public ArrayList < OvhSpecificNumber > number_specificNumbers_GET ( OvhNumberCountryEnum country , String range , OvhNumberTypeEnum type , String zone ) throws IOException { String qPath = "/telephony/number/specificNumbers" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "range" , range ) ; query ( sb , "type" , type ) ; query ( sb , "zone" , zone ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t22 ) ; } | Get all available specific number from a country |
13,340 | public ArrayList < OvhCity > directories_cities_GET ( OvhNumberCountryEnum country , String zipCode ) throws IOException { String qPath = "/telephony/directories/cities" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "zipCode" , zipCode ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t23 ) ; } | Get city informations from a zip code |
13,341 | public ArrayList < String > directories_availableZipCodes_GET ( OvhNumberCountryEnum country , String number ) throws IOException { String qPath = "/telephony/directories/availableZipCodes" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "number" , number ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; } | Get all zip codes compatible for a number |
13,342 | public OvhSound sounds_POST ( String description , String filename ) throws IOException { String qPath = "/telephony/sounds" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "description" , description ) ; addBody ( o , "filename" , filename ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhSound . class ) ; } | Create a new sound |
13,343 | public ArrayList < OvhLinePhone > line_offer_phones_GET ( OvhNumberCountryEnum country , String offer ) throws IOException { String qPath = "/telephony/line/offer/phones" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "offer" , offer ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t8 ) ; } | Get all available phone brands compatible with lines |
13,344 | public ArrayList < OvhLineOffer > fax_offers_GET ( OvhNumberCountryEnum country ) throws IOException { String qPath = "/telephony/fax/offers" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t15 ) ; } | Get all available fax offer compatible |
13,345 | public void spare_spare_replace_POST ( String spare , String domain , String ip ) throws IOException { String qPath = "/telephony/spare/{spare}/replace" ; StringBuilder sb = path ( qPath , spare ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "ip" , ip ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; } | Replace the phone by its spare . The broken phone became a spare if it was bought . An RMA is created if the broken phone is under securitydeposit . |
13,346 | public ArrayList < String > spare_brands_GET ( ) throws IOException { String qPath = "/telephony/spare/brands" ; StringBuilder sb = path ( qPath ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; } | Get all available spare brands |
13,347 | void removeResourceModels ( final Bundle bundle ) { this . logger . info ( "Removing resource models of bundle " + displayNameOf ( bundle ) + "..." ) ; MatchedBundlesPredicate sourcesWithBundles = new MatchedBundlesPredicate ( bundle ) ; for ( Collection < OsgiModelSource < ? > > values : this . typeNameToModelSourcesMap . values ( ) ) { CollectionUtils . filter ( values , sourcesWithBundles ) ; } clearLookupCaches ( ) ; this . logger . info ( "Removed " + sourcesWithBundles . getFilteredElements ( ) + " resource models of bundle " + displayNameOf ( bundle ) + "..." ) ; } | Removes all resource models originating from the given bundle from this registry . |
13,348 | public synchronized void removeMetadataForModelsIn ( Bundle bundle ) { if ( bundle == null ) { throw new IllegalArgumentException ( "method parameter bundle must not be null" ) ; } Map < Class < ? > , ResourceModelMetadataHolder > newCache = copyCache ( ) ; Iterator < Map . Entry < Class < ? > , ResourceModelMetadataHolder > > it = newCache . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { OsgiModelSource < ? > source = it . next ( ) . getValue ( ) . source ; if ( source . getBundleId ( ) == bundle . getBundleId ( ) ) { it . remove ( ) ; } } this . cache = newCache ; } | Removes the metadata of all models contained in the provided bundle from the registrar . |
13,349 | private static boolean isPropertyType ( Class < ? > type ) { return type . isPrimitive ( ) || type == String . class || type == Date . class || type == Calendar . class || ClassUtils . wrapperToPrimitive ( type ) != null ; } | Whether a property cannot be represented by a resource but must stem from a value map representing the properties of a resource . |
13,350 | public void removeValue ( V value ) { if ( value == null ) { throw new IllegalArgumentException ( "Method argument value must not be null." ) ; } for ( Collection < V > values : values ( ) ) { values . remove ( value ) ; } } | Removes the given value from all collections stored under any key . |
13,351 | public void onOsgiApplicationEvent ( OsgiBundleApplicationContextEvent event ) { if ( event instanceof OsgiBundleContextFailedEvent ) { final Bundle bundle = event . getBundle ( ) ; handleStop ( bundle ) ; stop ( bundle ) ; } } | This method is executed asynchronously since the original extender thread may try to obtain a lock to the OSGi framework s registry state during the stop while holding the event handling lock which may result in a transitive deadlock . |
13,352 | void handleStop ( Bundle bundle ) { if ( bundle == null ) { throw new IllegalArgumentException ( "Method argument bundle must not be null." ) ; } this . logger . info ( "Removing infrastructure for bundle: " + bundle + "..." ) ; this . modelRegistrar . unregister ( bundle ) ; this . dispatcherServlet . disableMvc ( bundle ) ; this . logger . info ( "Infrastructure for {} removed." , bundle ) ; } | We must guarantee the order in which the event is consumed by the collaborators since subsequent operations may depend on the resulting state . |
13,353 | public static < K , T extends Collection < K > > Collection < K > instantiateCollectionType ( Class < T > collectionType ) { return instantiateCollectionType ( collectionType , DEFAULT_COLLECTION_SIZE ) ; } | Creates an instance with a default capacity . |
13,354 | public static List < Method > methodsOf ( Class < ? > type ) { if ( type == null ) { throw new IllegalArgumentException ( "Method argument type must not be null" ) ; } List < Method > methods = new LinkedList < > ( ) ; Queue < Class < ? > > classes = new LinkedList < > ( ) ; classes . add ( type ) ; while ( ! classes . isEmpty ( ) ) { Class < ? > c = classes . poll ( ) ; methods . addAll ( asList ( c . getDeclaredMethods ( ) ) ) ; if ( c . getSuperclass ( ) != null ) { classes . add ( c . getSuperclass ( ) ) ; } addAll ( classes , c . getInterfaces ( ) ) ; } return methods ; } | All methods of the given type its super types and interfaces starting with the methods of the given type . |
13,355 | public ResourceModelStatistics countMappingDuration ( int durationInMs ) { for ( int i = 0 ; i < this . indexBoundaries . length ; ++ i ) { if ( durationInMs < this . indexBoundaries [ i ] ) { ++ this . mappingDurationFrequencies [ i ] ; return this ; } } ++ this . mappingDurationFrequencies [ this . mappingDurationFrequencies . length - 1 ] ; return this ; } | Adds the mapping with the duration to the statistics . |
13,356 | public static String [ ] appendToAll ( String append , String [ ] appendTo ) { if ( append == null ) { throw new IllegalArgumentException ( "Method argument append must not be null." ) ; } if ( appendTo == null ) { throw new IllegalArgumentException ( "Method argument to must not be null." ) ; } String [ ] result = new String [ appendTo . length ] ; for ( int i = 0 ; i < appendTo . length ; ++ i ) { result [ i ] = appendTo [ i ] == null ? null : appendTo [ i ] + append ; } return result ; } | Appends the given String to all elements of the given array . |
13,357 | public static ChronoZonedDateTime zonedTime ( final Object target , final ZoneId defaultZoneId ) { Validate . notNull ( target , "Target cannot be null" ) ; Validate . notNull ( defaultZoneId , "ZoneId cannot be null" ) ; if ( target instanceof Instant ) { return ZonedDateTime . ofInstant ( ( Instant ) target , defaultZoneId ) ; } else if ( target instanceof LocalDate ) { return ZonedDateTime . of ( ( LocalDate ) target , LocalTime . MIDNIGHT , defaultZoneId ) ; } else if ( target instanceof LocalDateTime ) { return ZonedDateTime . of ( ( LocalDateTime ) target , defaultZoneId ) ; } else if ( target instanceof LocalTime ) { return ZonedDateTime . of ( LocalDate . now ( ) , ( LocalTime ) target , defaultZoneId ) ; } else if ( target instanceof OffsetDateTime ) { return ( ( OffsetDateTime ) target ) . toZonedDateTime ( ) ; } else if ( target instanceof OffsetTime ) { LocalTime localTime = ( ( OffsetTime ) target ) . toLocalTime ( ) ; return ZonedDateTime . of ( LocalDate . now ( ) , localTime , defaultZoneId ) ; } else if ( target instanceof Year ) { LocalDate localDate = ( ( Year ) target ) . atDay ( 1 ) ; return ZonedDateTime . of ( localDate , LocalTime . MIDNIGHT , defaultZoneId ) ; } else if ( target instanceof YearMonth ) { LocalDate localDate = ( ( YearMonth ) target ) . atDay ( 1 ) ; return ZonedDateTime . of ( localDate , LocalTime . MIDNIGHT , defaultZoneId ) ; } else if ( target instanceof ZonedDateTime ) { return ( ChronoZonedDateTime ) target ; } else { throw new IllegalArgumentException ( "Cannot format object of class \"" + target . getClass ( ) . getName ( ) + "\" as a date" ) ; } } | Creates a Temporal object filling the missing fields of the provided time with default values . |
13,358 | public boolean export ( Context context , Class < ? > spaceClass , String accessToken ) { successful = false ; final SpaceHelper helper = crateSpaceHelper ( spaceClass ) ; final String outputPath = createOutputPath ( helper ) ; final CountDownLatch countDownLatch = new CountDownLatch ( 1 ) ; final Vault vault = Vault . with ( context , spaceClass ) ; vault . requestSync ( SyncConfig . builder ( ) . setSpaceId ( helper . getSpaceId ( ) ) . setAccessToken ( accessToken ) . build ( ) , new SyncCallback ( ) { public void onResult ( SyncResult result ) { try { successful = saveResultInDatabaseFile ( result , vault , outputPath ) ; } catch ( Throwable t ) { t . printStackTrace ( System . err ) ; } finally { countDownLatch . countDown ( ) ; } } } , new Executor ( ) { public void execute ( Runnable runnable ) { runnable . run ( ) ; } } ) ; try { countDownLatch . await ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( System . err ) ; } return successful ; } | Use this method to export Contentful spaces into sqlite3 databases which can be imported later . |
13,359 | public static String generateSetupJavaScript ( List < String > prefixes ) { Map < String , String > webJars = new WebJarAssetLocator ( ) . getWebJars ( ) ; return generateSetupJavaScript ( prefixes , webJars ) ; } | Returns the JavaScript that is used to setup the RequireJS config . This value is not cached . |
13,360 | public static Map < String , ObjectNode > generateSetupJson ( List < Map . Entry < String , Boolean > > prefixes ) { Map < String , String > webJars = new WebJarAssetLocator ( ) . getWebJars ( ) ; Map < String , ObjectNode > jsonConfigs = new HashMap < > ( ) ; for ( Map . Entry < String , String > webJar : webJars . entrySet ( ) ) { jsonConfigs . put ( webJar . getKey ( ) , getWebJarSetupJson ( webJar , prefixes ) ) ; } return jsonConfigs ; } | Returns the JSON used to setup the RequireJS config for each WebJar in the CLASSPATH . This value is not cached . |
13,361 | private static String requireJsConfigErrorMessage ( Map . Entry < String , String > webJar ) { return "Could not read WebJar RequireJS config for: " + webJar . getKey ( ) + " " + webJar . getValue ( ) + "\n" + "Please file a bug at: http://github.com/webjars/" + webJar . getKey ( ) + "/issues/new" ; } | A generic error message for when the RequireJS config could not be parsed out of the WebJar s pom . xml meta - data . |
13,362 | public static String getWebJarConfig ( Map . Entry < String , String > webJar ) { String webJarConfig = "" ; String filename = WebJarAssetLocator . WEBJARS_PATH_PREFIX + "/" + webJar . getKey ( ) + "/" + webJar . getValue ( ) + "/" + "webjars-requirejs.js" ; InputStream inputStream = RequireJS . class . getClassLoader ( ) . getResourceAsStream ( filename ) ; if ( inputStream != null ) { log . warn ( "The " + webJar . getKey ( ) + " " + webJar . getValue ( ) + " WebJar is using the legacy RequireJS config.\n" + "Please try a new version of the WebJar or file or file an issue at:\n" + "http://github.com/webjars/" + webJar . getKey ( ) + "/issues/new" ) ; StringBuilder webJarConfigBuilder = new StringBuilder ( "// WebJar config for " + webJar . getKey ( ) + "\n" ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; try { String line ; while ( ( line = br . readLine ( ) ) != null ) { webJarConfigBuilder . append ( line ) . append ( "\n" ) ; } webJarConfig = webJarConfigBuilder . toString ( ) ; } catch ( IOException e ) { log . warn ( filename + " could not be read." ) ; } finally { try { br . close ( ) ; } catch ( IOException e ) { } } } return webJarConfig ; } | The legacy webJars - requirejs . js based RequireJS config for a WebJar . |
13,363 | @ SuppressWarnings ( "unchecked" ) public static < E extends Enum < ? extends Style . HasCssName > > E fromStyleName ( final String styleName , final Class < E > enumClass , final E defaultValue ) { if ( styleName == null || enumClass == null ) { return defaultValue ; } for ( final Enum < ? extends Style . HasCssName > constant : enumClass . getEnumConstants ( ) ) { final Style . HasCssName anEnum = ( Style . HasCssName ) constant ; final String cssClass = anEnum . getCssName ( ) ; if ( cssClass != null && StyleHelper . containsStyle ( styleName , cssClass ) ) { return ( E ) anEnum ; } } return defaultValue ; } | Returns first enum constant found in at space - separated list of style names . |
13,364 | public static SimpleRadioButton wrap ( Element element ) { assert Document . get ( ) . getBody ( ) . isOrHasChild ( element ) ; SimpleRadioButton radioButton = new SimpleRadioButton ( InputElement . as ( element ) ) ; radioButton . onAttach ( ) ; RootPanel . detachOnWindowClose ( radioButton ) ; return radioButton ; } | Creates a SimpleRadioButton widget that wraps an existing < ; input type = radio > ; element . |
13,365 | public List < EditorError > createErrorList ( Editor < T > editor , T value , String messageKey ) { List < EditorError > result = new ArrayList < EditorError > ( ) ; result . add ( new BasicEditorError ( editor , value , getInvalidMessage ( messageKey ) ) ) ; return result ; } | Creates the error list . |
13,366 | private void ensureId ( final Element element ) { final String id = element . getId ( ) ; if ( id == null || id . isEmpty ( ) ) { element . setId ( Document . get ( ) . createUniqueId ( ) ) ; } } | Ensures the given element has a non - empty id . |
13,367 | public static void setHiddenOn ( final UIObject uiObject , final DeviceSize deviceSize ) { final String [ ] deviceString = deviceSize . name ( ) . split ( "_" ) ; for ( final String device : deviceString ) { final DeviceSize size = DeviceSize . valueOf ( device ) ; switch ( size ) { case PRINT : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_PRINT ) ; break ; case XS : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_XS ) ; break ; case SM : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_SM ) ; break ; case MD : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_MD ) ; break ; case LG : addEnumStyleName ( uiObject , Responsiveness . HIDDEN_LG ) ; break ; default : break ; } } } | Sets the ui object to be hidden on the device size |
13,368 | public static void setVisibleOn ( final UIObject uiObject , final DeviceSize deviceSize ) { final String [ ] deviceString = deviceSize . name ( ) . split ( "_" ) ; for ( final String device : deviceString ) { final DeviceSize size = DeviceSize . valueOf ( device ) ; switch ( size ) { case PRINT : addEnumStyleName ( uiObject , Responsiveness . VISIBLE_PRINT ) ; break ; case XS : addEnumStyleName ( uiObject , Responsiveness . VISIBLE_XS ) ; break ; case SM : addEnumStyleName ( uiObject , Responsiveness . VISIBLE_SM ) ; break ; case MD : addEnumStyleName ( uiObject , Responsiveness . VISIBLE_MD ) ; break ; case LG : addEnumStyleName ( uiObject , Responsiveness . VISIBLE_LG ) ; break ; default : break ; } } } | Sets the ui object to be visible on the device size |
13,369 | public static ScrollSpy scrollSpy ( final UIObject spyOn , final String selector ) { return new ScrollSpy ( spyOn . getElement ( ) , selector ) ; } | Attaches ScrollSpy to specified object with specified target selector . |
13,370 | public static ScrollSpy scrollSpy ( final UIObject spyOn , final HasId target ) { return new ScrollSpy ( spyOn . getElement ( ) , target ) ; } | Attaches ScrollSpy to specified object with specified target element . |
13,371 | public void setIconType ( IconType type ) { IconType prevType = iconType ; iconType = type ; if ( iconType != prevType && iconElement != null ) { iconElement . removeFromParent ( ) ; iconElement = null ; DomEvent . fireNativeEvent ( Document . get ( ) . createChangeEvent ( ) , this ) ; } } | Sets the icon type . If the icon type changes programatically then the icon is removed from the dom and recreated . |
13,372 | public static SimpleCheckBox wrap ( Element element ) { assert Document . get ( ) . getBody ( ) . isOrHasChild ( element ) ; SimpleCheckBox checkBox = new SimpleCheckBox ( InputElement . as ( element ) ) ; checkBox . onAttach ( ) ; RootPanel . detachOnWindowClose ( checkBox ) ; return checkBox ; } | Creates a SimpleCheckBox widget that wraps an existing < ; input type = checkbox > ; element . |
13,373 | private void call ( final Element e , final String arg ) { JQuery . jQuery ( e ) . popover ( arg ) ; } | Call the native popover method with the given argument . |
13,374 | private void popover ( Element e , String content ) { e . setAttribute ( "data-content" , content ) ; JQuery . jQuery ( e ) . popover ( ) ; } | Create the popover . |
13,375 | public void setAttribute ( final String attributeName , final String attributeValue ) { uiObject . getElement ( ) . setAttribute ( attributeName , attributeValue ) ; } | Sets the attribute on the UiObject |
13,376 | private void updatePaginationState ( final SimplePager pager ) { for ( int i = 0 ; i < getWidgetCount ( ) ; i ++ ) { if ( i == 0 ) { ( ( AnchorListItem ) getWidget ( i ) ) . setEnabled ( pager . hasPreviousPage ( ) ) ; } else if ( i == getWidgetCount ( ) - 1 ) { ( ( AnchorListItem ) getWidget ( i ) ) . setEnabled ( pager . hasNextPage ( ) ) ; } else { int index = i - 1 ; if ( index == pager . getPage ( ) ) { ( ( AnchorListItem ) getWidget ( i ) ) . setActive ( true ) ; } else { ( ( AnchorListItem ) getWidget ( i ) ) . setActive ( false ) ; } } } } | This updates the current active page and the enabled state of the previous and next buttons in the Pagination based on the state of the given SimplePager . |
13,377 | public void insert ( final Widget child , final int beforeIndex ) { insert ( child , ( Element ) getElement ( ) , beforeIndex , true ) ; } | Inserts a widget at a specific index |
13,378 | public < T extends Widget & HasValidators < ? > > void add ( final T field ) { fields . put ( field , field . validate ( false ) ) ; if ( field . isAttached ( ) ) { updateStateAndNotify ( ) ; } registrations . put ( field , field . addValidationChangedHandler ( new ValidationChangedHandler ( ) { public void onValidationChanged ( ValidationChangedEvent event ) { fields . put ( field , event . isValid ( ) ) ; if ( fireEvents ) { updateStateAndNotify ( ) ; } } } ) ) ; } | Adds a field to the group . |
13,379 | public < T extends Widget & HasValidators < ? > > boolean remove ( final T field ) { fields . remove ( ( HasValidators < ? > ) field ) ; HandlerRegistration reg = registrations . remove ( ( HasValidators < ? > ) field ) ; if ( reg != null ) { reg . removeHandler ( ) ; return true ; } return false ; } | Removes a field from the validation group . |
13,380 | public void setSize ( final ColumnSize firstSize , final ColumnSize ... otherSizes ) { addEnumVarargsValues ( new ColumnSize [ ] { firstSize } , ColumnSize . class , true ) ; addEnumVarargsValues ( otherSizes , ColumnSize . class , false ) ; } | Adds one or more additional column sizes . |
13,381 | protected Set < Radio > getRadioChildren ( final Widget widget , final Set < Radio > c ) { Set < Radio > children = c ; if ( children == null ) { children = new HashSet < Radio > ( ) ; } if ( widget instanceof Radio ) { children . add ( ( Radio ) widget ) ; } else if ( widget instanceof HasOneWidget ) { children = getRadioChildren ( ( ( HasOneWidget ) widget ) . getWidget ( ) , children ) ; } else if ( widget instanceof HasWidgets ) { for ( Widget w : ( HasWidgets ) widget ) { if ( w instanceof Radio ) { children . add ( ( Radio ) w ) ; } else { children = getRadioChildren ( w , children ) ; } } } return children ; } | Gets the radio children . |
13,382 | protected void updateChildren ( ) { for ( Radio child : getRadioChildren ( ) ) { HandlerRegistration reg = valueChangedRegistrations . get ( child ) ; if ( reg == null ) { valueChangedRegistrations . put ( child , child . addValueChangeHandler ( changeHandler ) ) ; } child . setName ( name ) ; } } | Update the radio children names . |
13,383 | private void call ( final Element e , final String arg ) { JQuery . jQuery ( e ) . tooltip ( arg ) ; } | Call the native tooltip method with the given argument . |
13,384 | public void setName ( final String name ) { this . name = name ; if ( name == null ) { return ; } for ( final Widget w : getChildren ( ) ) { if ( w instanceof HasName ) { ( ( HasName ) w ) . setName ( name ) ; } } } | Convenience method that will set the name of all child widgets that can have a name |
13,385 | private Map getCurrentStep ( Phase phase ) { String target = phase . ordinal ( ) <= Phase . match . ordinal ( ) ? Phase . match . name ( ) : Phase . result . name ( ) ; Map lastWithValue = null ; for ( Map stepOrHook : getSteps ( ) ) { if ( stepOrHook . get ( target ) == null ) { return stepOrHook ; } else { lastWithValue = stepOrHook ; } } return lastWithValue ; } | In order to handle steps being added all at once this method determines allows methods to opperator correctly if |
13,386 | public void syntaxError ( String state , String event , List < String > legalEvents , String uri , Integer line ) { formatter . syntaxError ( state , event , legalEvents , uri , line ) ; } | Not part of the API . Used for testing only . |
13,387 | public JCodeModel getCodeModel ( String basePackage , String schemaLocation , Annotator annotator ) { if ( type != null ) { return codeModel ; } else { return SchemaHelper . buildBodyJCodeModel ( schemaLocation , basePackage , name , schema , annotator ) ; } } | Builds a JCodeModel for this body |
13,388 | public Set < ApiResourceMetadata > extractControllers ( JCodeModel bodyCodeModel , RamlRoot raml ) { Set < ApiResourceMetadata > controllers = new LinkedHashSet < > ( ) ; if ( raml == null ) { return controllers ; } if ( bodyCodeModel == null ) { bodyCodeModel = new JCodeModel ( ) ; } Set < String > names = new LinkedHashSet < > ( ) ; Set < String > namesToDisable = new LinkedHashSet < > ( ) ; for ( Entry < String , RamlResource > resource : raml . getResources ( ) . entrySet ( ) ) { Set < ApiResourceMetadata > resources = checkResource ( bodyCodeModel , startUrl , resource . getValue ( ) , null , raml ) ; for ( ApiResourceMetadata resourceMetadata : resources ) { if ( names . contains ( resourceMetadata . getResourceName ( ) ) ) { namesToDisable . add ( resourceMetadata . getResourceName ( ) ) ; } names . add ( resourceMetadata . getResourceName ( ) ) ; controllers . add ( resourceMetadata ) ; } } for ( ApiResourceMetadata resourceMetadata : controllers ) { if ( namesToDisable . contains ( resourceMetadata . getResourceName ( ) ) ) { resourceMetadata . setSingularizeName ( false ) ; } } return controllers ; } | This method will extract a set of controllers from the RAML file . These controllers will contain the metadata required by the code generator including name any annotations as well as conatining methods |
13,389 | private Set < ApiResourceMetadata > checkResource ( JCodeModel bodyCodeModel , String baseUrl , RamlResource resource , ApiResourceMetadata controller , RamlRoot document ) { Set < ApiResourceMetadata > controllers = new LinkedHashSet < > ( ) ; String url = baseUrl + resource . getRelativeUri ( ) ; if ( controller == null && shouldCreateController ( resource ) ) { controller = new ApiResourceMetadata ( bodyCodeModel , url , resource , document ) ; controllers . add ( controller ) ; } if ( resource . getActions ( ) != null && ! resource . getActions ( ) . isEmpty ( ) ) { for ( RamlActionType actionType : RamlActionType . values ( ) ) { if ( resource . getActions ( ) . containsKey ( actionType ) ) { RamlAction childResource = resource . getActions ( ) . get ( actionType ) ; RamlResponse response = null ; if ( childResource . getResponses ( ) != null ) { response = RamlHelper . getSuccessfulResponse ( childResource ) ; } if ( Config . isSeperateMethodsByContentType ( ) && response != null && response . hasBody ( ) && response . getBody ( ) . size ( ) > 1 ) { for ( String responseType : response . getBody ( ) . keySet ( ) ) { controller . addApiCall ( resource , actionType , childResource , responseType ) ; } } else { controller . addApiCall ( resource , actionType , childResource , null ) ; } } } } if ( resource . getResources ( ) != null && ! resource . getResources ( ) . isEmpty ( ) ) { for ( Entry < String , RamlResource > childResource : resource . getResources ( ) . entrySet ( ) ) { controllers . addAll ( checkResource ( bodyCodeModel , url , childResource . getValue ( ) , controller , document ) ) ; } } return controllers ; } | Recursive method to parse resources in a Raml File . It tries to go as deep as possible before creating the root Resource . Once this is done methods and child resources will be relative to the root resource |
13,390 | private Set < String > getAllReferencedTypeNames ( Set < ApiResourceMetadata > controllers ) { Set < String > parametersNames = controllers . stream ( ) . flatMap ( resourceMetadata -> resourceMetadata . getParameters ( ) . stream ( ) ) . map ( apiParameter -> StringUtils . capitalize ( apiParameter . getName ( ) ) ) . collect ( Collectors . toSet ( ) ) ; Set < String > bodyNames = controllers . stream ( ) . flatMap ( resourceMetadata -> resourceMetadata . getDependencies ( ) . stream ( ) ) . map ( ApiBodyMetadata :: getName ) . collect ( Collectors . toSet ( ) ) ; bodyNames . addAll ( parametersNames ) ; return bodyNames ; } | Fetches all referenced type names so as to not generate classes multiple times |
13,391 | public static RamlRoot loadRamlFromFile ( String ramlFileUrl ) { try { return createRamlModelFactoryFor ( ramlFileUrl ) . buildRamlRoot ( ramlFileUrl ) ; } catch ( NullPointerException npe ) { logger . error ( "File not found at {}" , ramlFileUrl ) ; return null ; } } | Loads a RAML document from a file . This method will |
13,392 | private boolean doesActionTypeSupportRequestBody ( RamlActionType target ) { return target . equals ( RamlActionType . POST ) || target . equals ( RamlActionType . PUT ) || target . equals ( RamlActionType . PATCH ) || target . equals ( RamlActionType . DELETE ) ; } | Method to check if a specific action type supports payloads in the body of the request |
13,393 | public static String resolveSchema ( String schema , RamlRoot document ) { if ( document == null || schema == null || schema . indexOf ( "{" ) != - 1 ) { return null ; } if ( document . getSchemas ( ) != null && ! document . getSchemas ( ) . isEmpty ( ) ) { for ( Map < String , String > map : document . getSchemas ( ) ) { if ( map . containsKey ( schema ) ) { return map . get ( schema ) ; } } } return null ; } | Utility method that will return a schema if the identifier is valid and exists in the raml file definition . |
13,394 | public static Class < ? > mapSimpleType ( RamlParamType param , String format , String rawType ) { switch ( param ) { case BOOLEAN : return Boolean . class ; case DATE : return mapDateFormat ( rawType ) ; case INTEGER : { Class < ? > fromFormat = mapNumberFromFormat ( format ) ; if ( fromFormat == Double . class ) { throw new IllegalStateException ( ) ; } if ( fromFormat == null ) { return Long . class ; } else { return fromFormat ; } } case NUMBER : { Class < ? > fromFormat = mapNumberFromFormat ( format ) ; if ( fromFormat == null ) { return BigDecimal . class ; } else { return fromFormat ; } } case FILE : return MultipartFile . class ; default : return String . class ; } } | Maps simple types supported by RAML into primitives and other simple Java types |
13,395 | private static String extractTopItem ( String searchString , String schema , int startIdx ) { String extracted = null ; int propIdx = schema . indexOf ( "\"properties\"" , startIdx ) ; if ( propIdx == - 1 ) { propIdx = Integer . MAX_VALUE ; } int idIdx = schema . indexOf ( "\"" + searchString + "\"" , startIdx ) ; int secondIdIdx = schema . indexOf ( "\"" + searchString + "\"" , idIdx + 1 ) ; if ( secondIdIdx != - 1 && propIdx > secondIdIdx ) { idIdx = secondIdIdx ; } if ( idIdx != - 1 && propIdx > idIdx ) { int valueStartIdx = schema . indexOf ( "\"" , idIdx + ( searchString . length ( ) + 2 ) ) ; int valueEndIdx = schema . indexOf ( "\"" , valueStartIdx + 1 ) ; extracted = schema . substring ( valueStartIdx + 1 , valueEndIdx ) ; } return extracted ; } | Extracts the value of a specified parameter in a schema |
13,396 | public static JCodeModel buildBodyJCodeModel ( String basePackage , String schemaLocation , String name , String schema , Annotator annotator ) { JCodeModel codeModel = new JCodeModel ( ) ; SchemaStore schemaStore = new SchemaStore ( ) ; GenerationConfig config = Config . getPojoConfig ( ) ; if ( config == null ) { config = getDefaultGenerationConfig ( ) ; } if ( annotator == null ) { annotator = new Jackson2Annotator ( config ) ; } RuleFactory ruleFactory = new RuleFactory ( config , annotator , schemaStore ) ; SchemaMapper mapper = new SchemaMapper ( ruleFactory , new SchemaGenerator ( ) ) ; boolean useParent = StringUtils . hasText ( schemaLocation ) ; try { if ( useParent ) { mapper . generate ( codeModel , name , basePackage , schema , new URI ( schemaLocation ) ) ; } else { mapper . generate ( codeModel , name , basePackage , schema ) ; } } catch ( Exception e ) { if ( useParent && e . getMessage ( ) . contains ( "classpath" ) ) { logger . debug ( "Referenced Schema contains self $refs or not found in classpath. Regenerating model withouth classpath: for " + name ) ; codeModel = new JCodeModel ( ) ; try { mapper . generate ( codeModel , name , basePackage , schema ) ; return codeModel ; } catch ( IOException e1 ) { } } logger . error ( "Error generating pojo from schema" + name , e ) ; return null ; } return codeModel ; } | Builds a JCodeModel for classes that will be used as Request or Response bodies |
13,397 | public static GenerationConfig getGenerationConfig ( Boolean generateBuilders , Boolean includeAdditionalProperties , Boolean includeDynamicAccessors , Boolean useLongIntegers ) { return new DefaultGenerationConfig ( ) { public boolean isGenerateBuilders ( ) { if ( generateBuilders != null ) { return generateBuilders ; } else { return true ; } } public boolean isIncludeAdditionalProperties ( ) { if ( includeAdditionalProperties != null ) { return includeAdditionalProperties ; } else { return false ; } } public boolean isIncludeDynamicAccessors ( ) { if ( includeDynamicAccessors != null ) { return includeDynamicAccessors ; } else { return false ; } } public boolean isUseLongIntegers ( ) { if ( useLongIntegers != null ) { return useLongIntegers ; } else { return super . isUseLongIntegers ( ) ; } } } ; } | Returns a generation config with the supplied parameters . If any of these parameters are supplied null it will use the value defined in the default configuration |
13,398 | public static String getElementAsString ( JDeclaration type ) { StringBuilder builder = new StringBuilder ( ) ; JFormatter jFormatter = new JFormatter ( new StringBuilderWriter ( builder ) ) ; type . declare ( jFormatter ) ; return builder . toString ( ) ; } | Returns the string equivalent of the code model element |
13,399 | public void annotateFieldJSR303 ( JMethod getter , boolean addValidAnnotation ) { if ( isRequired ( ) ) { getter . annotate ( NotNull . class ) ; } if ( StringUtils . hasText ( getPattern ( ) ) ) { JAnnotationUse annotation = getter . annotate ( Pattern . class ) ; annotation . param ( "regexp" , getPattern ( ) ) ; } if ( getMinLength ( ) != null || getMaxLength ( ) != null ) { JAnnotationUse annotation = getter . annotate ( Size . class ) ; if ( getMinLength ( ) != null ) { annotation . param ( "min" , getMinLength ( ) ) ; } if ( getMaxLength ( ) != null ) { annotation . param ( "max" , getMaxLength ( ) ) ; } } if ( addValidAnnotation ) { getter . annotate ( Valid . class ) ; } if ( minimum != null ) { JAnnotationUse annotation = getter . annotate ( DecimalMin . class ) ; annotation . param ( "value" , String . valueOf ( minimum ) ) ; } if ( maximum != null ) { JAnnotationUse annotation = getter . annotate ( DecimalMax . class ) ; annotation . param ( "value" , String . valueOf ( maximum ) ) ; } } | Adds validation annotations to the supplied method |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.