idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
14,600 | public SheetResources sheetResources ( ) { if ( sheets . get ( ) == null ) { sheets . compareAndSet ( null , new SheetResourcesImpl ( this ) ) ; } return sheets . get ( ) ; } | Returns the SheetResources instance that provides access to Sheet resources . | 45 | 12 |
14,601 | public SightResources sightResources ( ) { if ( sights . get ( ) == null ) { sights . compareAndSet ( null , new SightResourcesImpl ( this ) ) ; } return sights . get ( ) ; } | Returns the SightResources instance that provides access to Sight resources . | 45 | 12 |
14,602 | public FavoriteResources favoriteResources ( ) { if ( favorites . get ( ) == null ) { favorites . compareAndSet ( null , new FavoriteResourcesImpl ( this ) ) ; } return favorites . get ( ) ; } | Returns the FavoriteResources instance that provides access to Favorite resources . | 45 | 12 |
14,603 | public TokenResources tokenResources ( ) { if ( tokens . get ( ) == null ) { tokens . compareAndSet ( null , new TokenResourcesImpl ( this ) ) ; } return tokens . get ( ) ; } | Returns the TokenResources instance that provides access to token resources . | 45 | 12 |
14,604 | public ContactResources contactResources ( ) { if ( contacts . get ( ) == null ) { contacts . compareAndSet ( null , new ContactResourcesImpl ( this ) ) ; } return contacts . get ( ) ; } | Returns the ContactResources instance that provides access to contact resources . | 45 | 12 |
14,605 | public ImageUrlResources imageUrlResources ( ) { if ( imageUrls . get ( ) == null ) { imageUrls . compareAndSet ( null , new ImageUrlResourcesImpl ( this ) ) ; } return imageUrls . get ( ) ; } | Returns the ImageUrlResources instance that provides access to image url resources . | 54 | 14 |
14,606 | public WebhookResources webhookResources ( ) { if ( webhooks . get ( ) == null ) { webhooks . compareAndSet ( null , new WebhookResourcesImpl ( this ) ) ; } return webhooks . get ( ) ; } | Returns the WebhookResources instance that provides access to webhook resources . | 54 | 14 |
14,607 | public PassthroughResources passthroughResources ( ) { if ( passthrough . get ( ) == null ) { passthrough . compareAndSet ( null , new PassthroughResourcesImpl ( this ) ) ; } return passthrough . get ( ) ; } | Returns the PassthroughResources instance that provides access to passthrough resources . | 57 | 16 |
14,608 | public Webhook updateWebhook ( Webhook webhook ) throws SmartsheetException { return this . updateResource ( "webhooks/" + webhook . getId ( ) , Webhook . class , webhook ) ; } | Updates the webhooks specified in the URL . | 48 | 11 |
14,609 | public WebhookSharedSecret resetSharedSecret ( long webhookId ) throws SmartsheetException { HttpRequest request = createHttpRequest ( this . getSmartsheet ( ) . getBaseURI ( ) . resolve ( "webhooks/" + webhookId + "/resetsharedsecret" ) , HttpMethod . POST ) ; HttpResponse response = getSmartsheet ( ) . getHttpClient ... | Resets the shared secret for the specified Webhook . For more information about how a shared secret is used see Authenticating Callbacks . | 256 | 27 |
14,610 | public static void throwIfNull ( Object obj1 , Object obj2 ) { if ( obj1 == null ) { throw new IllegalArgumentException ( ) ; } if ( obj2 == null ) { throw new IllegalArgumentException ( ) ; } } | faster util method that avoids creation of array for two - arg cases | 53 | 14 |
14,611 | public List < Row > addRows ( long sheetId , List < Row > rows ) throws SmartsheetException { return this . postAndReceiveList ( "sheets/" + sheetId + "/rows" , rows , Row . class ) ; } | Insert rows to a sheet . | 53 | 6 |
14,612 | public Row getRow ( long sheetId , long rowId , EnumSet < RowInclusion > includes , EnumSet < ObjectExclusion > excludes ) throws SmartsheetException { String path = "sheets/" + sheetId + "/rows/" + rowId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , Que... | Get a row . | 153 | 4 |
14,613 | public List < Row > updateRows ( long sheetId , List < Row > rows ) throws SmartsheetException { return this . putAndReceiveList ( "sheets/" + sheetId + "/rows" , rows , Row . class ) ; } | Update rows . | 53 | 3 |
14,614 | public static byte [ ] readBytesFromStream ( InputStream source , int bufferSize ) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream ( ) ; copyContentIntoOutputStream ( source , buffer , bufferSize , true ) ; return buffer . toByteArray ( ) ; } | read all bytes from an InputStream with the specified buffer size ; doesn t close input - stream | 63 | 19 |
14,615 | public static long copyContentIntoOutputStream ( InputStream source , OutputStream target , int bufferSize , boolean readToEOF ) throws IOException { byte [ ] tempBuf = new byte [ Math . max ( ONE_KB , bufferSize ) ] ; // at least a 1k buffer long bytesWritten = 0 ; while ( true ) { int bytesRead = source . read ( temp... | the real work - horse behind most of these methods | 145 | 10 |
14,616 | public static InputStream cloneContent ( InputStream source , int readbackSize , ByteArrayOutputStream target ) throws IOException { if ( source == null ) { return null ; } // if the source supports mark/reset then we read and then reset up to the read-back size if ( source . markSupported ( ) ) { readbackSize = Math .... | used when you want to clone a InputStream s content and still have it appear rewound to the stream beginning | 211 | 23 |
14,617 | public String getRequest ( String endpoint , HashMap < String , Object > parameters ) throws SmartsheetException { return passthroughRequest ( HttpMethod . GET , endpoint , null , parameters ) ; } | Issue an HTTP GET request . | 43 | 6 |
14,618 | public String postRequest ( String endpoint , String payload , HashMap < String , Object > parameters ) throws SmartsheetException { Util . throwIfNull ( payload ) ; return passthroughRequest ( HttpMethod . POST , endpoint , payload , parameters ) ; } | Issue an HTTP POST request . | 56 | 6 |
14,619 | public String putRequest ( String endpoint , String payload , HashMap < String , Object > parameters ) throws SmartsheetException { Util . throwIfNull ( payload ) ; return passthroughRequest ( HttpMethod . PUT , endpoint , payload , parameters ) ; } | Issue an HTTP PUT request . | 57 | 7 |
14,620 | public String deleteRequest ( String endpoint ) throws SmartsheetException { return passthroughRequest ( HttpMethod . DELETE , endpoint , null , null ) ; } | Issue an HTTP DELETE request . | 36 | 8 |
14,621 | public Comment addCommentWithAttachment ( long sheetId , long discussionId , Comment comment , File file , String contentType ) throws SmartsheetException , IOException { String path = "sheets/" + sheetId + "/discussions/" + discussionId + "/comments" ; Util . throwIfNull ( sheetId , comment , file , contentType ) ; re... | Add a comment to a discussion with an attachment . | 108 | 10 |
14,622 | public Comment updateComment ( long sheetId , Comment comment ) throws SmartsheetException { return this . updateResource ( "sheets/" + sheetId + "/comments/" + comment . getId ( ) , Comment . class , comment ) ; } | Update the specified comment | 50 | 4 |
14,623 | public ImageUrlMap getImageUrls ( List < ImageUrl > requestUrls ) throws SmartsheetException { Util . throwIfNull ( requestUrls ) ; HttpRequest request ; request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( "imageurls" ) , HttpMethod . POST ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( )... | Gets URLS that can be used to retieve the specified cell images . | 352 | 16 |
14,624 | public PagedResult < Workspace > listWorkspaces ( PaginationParameters parameters ) throws SmartsheetException { String path = "workspaces" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Workspace . class ) ; } | List all workspaces . | 67 | 5 |
14,625 | public Workspace getWorkspace ( long id , Boolean loadAll , EnumSet < SourceInclusion > includes ) throws SmartsheetException { String path = "workspaces/" + id ; // Add the parameters to a map and build the query string at the end HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameter... | Get a workspace . | 156 | 4 |
14,626 | public Workspace updateWorkspace ( Workspace workspace ) throws SmartsheetException { return this . updateResource ( "workspaces/" + workspace . getId ( ) , Workspace . class , workspace ) ; } | Update a workspace . | 44 | 4 |
14,627 | public PagedResult < Sheet > listSheets ( EnumSet < SourceInclusion > includes , PaginationParameters pagination ) throws SmartsheetException { return this . listSheets ( includes , pagination , null ) ; } | List all sheets . | 49 | 4 |
14,628 | @ Deprecated public PagedResult < Sheet > listOrganizationSheets ( PaginationParameters parameters ) throws SmartsheetException { String path = "users/sheets" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Sheet . class ) ; } | List all sheets in the organization . | 71 | 7 |
14,629 | public Sheet getSheet ( long id , EnumSet < SheetInclusion > includes , EnumSet < ObjectExclusion > excludes , Set < Long > rowIds , Set < Integer > rowNumbers , Set < Long > columnIds , Integer pageSize , Integer page ) throws SmartsheetException { return this . getSheet ( id , includes , excludes , rowIds , rowNumber... | Get a sheet . | 100 | 4 |
14,630 | public void getSheetAsPDF ( long id , OutputStream outputStream , PaperSize paperSize ) throws SmartsheetException { getSheetAsFile ( id , paperSize , outputStream , "application/pdf" ) ; } | Get a sheet as a PDF file . | 49 | 8 |
14,631 | public Sheet importCsv ( String file , String sheetName , Integer headerRowIndex , Integer primaryRowIndex ) throws SmartsheetException { return importFile ( "sheets/import" , file , "text/csv" , sheetName , headerRowIndex , primaryRowIndex ) ; } | Imports a sheet . | 60 | 5 |
14,632 | public Sheet importCsvInFolder ( long folderId , String file , String sheetName , Integer headerRowIndex , Integer primaryRowIndex ) throws SmartsheetException { return importFile ( "folders/" + folderId + "/sheets/import" , file , "text/csv" , sheetName , headerRowIndex , primaryRowIndex ) ; } | Imports a sheet in given folder . | 74 | 8 |
14,633 | public Sheet createSheetInWorkspace ( long workspaceId , Sheet sheet ) throws SmartsheetException { return this . createResource ( "workspaces/" + workspaceId + "/sheets" , Sheet . class , sheet ) ; } | Create a sheet in given workspace . | 48 | 7 |
14,634 | public Sheet importCsvInWorkspace ( long workspaceId , String file , String sheetName , Integer headerRowIndex , Integer primaryRowIndex ) throws SmartsheetException { return importFile ( "workspaces/" + workspaceId + "/sheets/import" , file , "text/csv" , sheetName , headerRowIndex , primaryRowIndex ) ; } | Imports a sheet in given workspace . | 75 | 8 |
14,635 | public SheetPublish updatePublishStatus ( long id , SheetPublish publish ) throws SmartsheetException { return this . updateResource ( "sheets/" + id + "/publish" , SheetPublish . class , publish ) ; } | Sets the publish status of a sheet and returns the new status including the URLs of any enabled publishings . | 50 | 22 |
14,636 | private Sheet importFile ( String path , String file , String contentType , String sheetName , Integer headerRowIndex , Integer primaryRowIndex ) throws SmartsheetException { Util . throwIfNull ( path , file , contentType ) ; Util . throwIfEmpty ( path , file , contentType ) ; File f = new File ( file ) ; HashMap < Str... | Internal function used by all of the import routines | 447 | 9 |
14,637 | public Sheet moveSheet ( long sheetId , ContainerDestination containerDestination ) throws SmartsheetException { String path = "sheets/" + sheetId + "/move" ; return this . createResource ( path , Sheet . class , containerDestination ) ; } | Moves the specified Sheet to another location . | 55 | 9 |
14,638 | public Attachment attachFile ( long objectId , InputStream inputStream , String contentType , long contentLength , String fileName ) { throw new UnsupportedOperationException ( "Attachments can only be attached to comments, not discussions." ) ; } | Throws an UnsupportedOperationException . | 51 | 8 |
14,639 | public PagedResult < Column > listColumns ( long sheetId , EnumSet < ColumnInclusion > includes , PaginationParameters pagination ) throws SmartsheetException { String path = "sheets/" + sheetId + "/columns" ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( pagination != null ) { par... | List columns of a given sheet . | 147 | 7 |
14,640 | public List < Column > addColumns ( long sheetId , List < Column > columns ) throws SmartsheetException { return this . postAndReceiveList ( "sheets/" + sheetId + "/columns" , columns , Column . class ) ; } | Add column to a sheet . | 54 | 6 |
14,641 | public Column updateColumn ( long sheetId , Column column ) throws SmartsheetException { Util . throwIfNull ( column ) ; return this . updateResource ( "sheets/" + sheetId + "/columns/" + column . getId ( ) , Column . class , column ) ; } | Update a column . | 61 | 4 |
14,642 | public Column getColumn ( long sheetId , long columnId , EnumSet < ColumnInclusion > includes ) throws SmartsheetException { String path = "sheets/" + sheetId + "/columns/" + columnId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , QueryUtil . generateComm... | Gets the Column specified in the URL . | 119 | 9 |
14,643 | public TColumn getColumnByIndex ( int index ) { if ( columns == null ) { return null ; } TColumn result = null ; for ( TColumn column : columns ) { if ( column . getIndex ( ) == index ) { result = column ; break ; } } return result ; } | Get a column by index . | 62 | 6 |
14,644 | public AbstractSheet < TRow , TColumn , TCell > setColumns ( List < TColumn > columns ) { this . columns = columns ; return this ; } | Sets the columns for the sheet . | 36 | 8 |
14,645 | public AbstractSheet < TRow , TColumn , TCell > setRows ( List < TRow > rows ) { this . rows = rows ; return this ; } | Sets the rows for the sheet . | 36 | 8 |
14,646 | public AbstractSheet < TRow , TColumn , TCell > setDiscussions ( List < Discussion > discussions ) { this . discussions = discussions ; return this ; } | Sets the discussions for the sheet . | 35 | 8 |
14,647 | public AbstractSheet < TRow , TColumn , TCell > setAttachments ( List < Attachment > attachments ) { this . attachments = attachments ; return this ; } | Sets the attachments for the sheet . | 36 | 8 |
14,648 | public AbstractSheet < TRow , TColumn , TCell > setEffectiveAttachmentOptions ( EnumSet < AttachmentType > effectiveAttachmentOptions ) { this . effectiveAttachmentOptions = effectiveAttachmentOptions ; return this ; } | Sets the effective attachment options . | 50 | 7 |
14,649 | public AbstractSheet < TRow , TColumn , TCell > setFilters ( List < SheetFilter > filters ) { this . filters = filters ; return this ; } | Sets the list of sheet filters for this sheet . | 36 | 11 |
14,650 | public AbstractSheet < TRow , TColumn , TCell > setCrossSheetReferences ( List < CrossSheetReference > crossSheetReferences ) { this . crossSheetReferences = crossSheetReferences ; return this ; } | Sets the list of cross sheet references used by this sheet | 49 | 12 |
14,651 | public HttpRequestBase createApacheRequest ( HttpRequest smartsheetRequest ) { HttpRequestBase apacheHttpRequest ; // Create Apache HTTP request based on the smartsheetRequest request type switch ( smartsheetRequest . getMethod ( ) ) { case GET : apacheHttpRequest = new HttpGet ( smartsheetRequest . getUri ( ) ) ; brea... | Create the Apache HTTP request . Override this function to inject additional haaders in the request or use a proxy . | 276 | 23 |
14,652 | public long calcBackoff ( int previousAttempts , long totalElapsedTimeMillis , Error error ) { long backoffMillis = ( long ) ( Math . pow ( 2 , previousAttempts ) * 1000 ) + new Random ( ) . nextInt ( 1000 ) ; if ( totalElapsedTimeMillis + backoffMillis > maxRetryTimeMillis ) { logger . info ( "Elapsed time " + totalEl... | The backoff calculation routine . Uses exponential backoff . If the maximum elapsed time has expired this calculation returns - 1 causing the caller to fall out of the retry loop . | 142 | 35 |
14,653 | public boolean shouldRetry ( int previousAttempts , long totalElapsedTimeMillis , HttpResponse response ) { String contentType = response . getEntity ( ) . getContentType ( ) ; if ( contentType != null && ! contentType . startsWith ( JSON_MIME_TYPE ) ) { // it's not JSON; don't even try to parse it return false ; } Err... | Called when an API request fails to determine if it can retry the request . Calls calcBackoff to determine the time to wait in between retries . | 341 | 32 |
14,654 | public void setTraces ( Trace ... traces ) { this . traces . clear ( ) ; for ( Trace trace : traces ) { if ( ! trace . addReplacements ( this . traces ) ) { this . traces . add ( trace ) ; } } } | set the traces for this client | 54 | 6 |
14,655 | public PagedResult < Attachment > getAttachments ( long sheetId , long rowId , PaginationParameters parameters ) throws SmartsheetException { String path = "sheets/" + sheetId + "/rows/" + rowId + "/attachments" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrap... | Get row attachment . | 89 | 4 |
14,656 | public Attachment attachFile ( long sheetId , long rowId , InputStream inputStream , String contentType , long contentLength , String attachmentName ) throws SmartsheetException { Util . throwIfNull ( inputStream , contentType ) ; return super . attachFile ( "sheets/" + sheetId + "/rows/" + rowId + "/attachments" , inp... | Attach file for simple upload . | 90 | 6 |
14,657 | public Discussion createDiscussion ( long sheetId , Discussion discussion ) throws SmartsheetException { Util . throwIfNull ( sheetId , discussion ) ; return this . createResource ( "sheets/" + sheetId + "/discussions" , Discussion . class , discussion ) ; } | Create a discussion on a sheet . | 57 | 7 |
14,658 | public Discussion createDiscussionWithAttachment ( long sheetId , Discussion discussion , File file , String contentType ) throws SmartsheetException , IOException { Util . throwIfNull ( discussion , file , contentType ) ; String path = "sheets/" + sheetId + "/discussions" ; return this . createDiscussionWithAttachment... | Create a discussion with attachments on a sheet . | 94 | 9 |
14,659 | public static RequestAndResponseData of ( HttpRequestBase request , HttpEntitySnapshot requestEntity , HttpResponse response , HttpEntitySnapshot responseEntity , Set < Trace > traces ) throws IOException { RequestData . Builder requestBuilder = new RequestData . Builder ( ) ; ResponseData . Builder responseBuilder = n... | factory method for creating a RequestAndResponseData object from request and response data with the specifid trace fields | 660 | 23 |
14,660 | protected < T > T getResource ( String path , Class < T > objectClass ) throws SmartsheetException { Util . throwIfNull ( path , objectClass ) ; if ( path . isEmpty ( ) ) { com . smartsheet . api . models . Error error = new com . smartsheet . api . models . Error ( ) ; error . setMessage ( "An empty path was provided.... | Get a resource from Smartsheet REST API . | 488 | 10 |
14,661 | protected < T > List < T > listResources ( String path , Class < T > objectClass ) throws SmartsheetException { Util . throwIfNull ( path , objectClass ) ; Util . throwIfEmpty ( path ) ; HttpRequest request ; request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( path ) , HttpMethod . GET ) ; List < T > ... | List resources using Smartsheet REST API . | 196 | 9 |
14,662 | protected < T > void deleteResource ( String path , Class < T > objectClass ) throws SmartsheetException { Util . throwIfNull ( path , objectClass ) ; Util . throwIfEmpty ( path ) ; HttpRequest request ; request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( path ) , HttpMethod . DELETE ) ; try { HttpRes... | Delete a resource from Smartsheet REST API . | 182 | 10 |
14,663 | protected < T > List < T > deleteListResources ( String path , Class < T > objectClass ) throws SmartsheetException { Util . throwIfNull ( path , objectClass ) ; Util . throwIfEmpty ( path ) ; Result < List < T > > obj = null ; HttpRequest request ; request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( ... | Delete resources and return a list from Smartsheet REST API . | 208 | 13 |
14,664 | protected < T , S > List < S > postAndReceiveList ( String path , T objectToPost , Class < S > objectClassToReceive ) throws SmartsheetException { Util . throwIfNull ( path , objectToPost , objectClassToReceive ) ; Util . throwIfEmpty ( path ) ; HttpRequest request = createHttpRequest ( smartsheet . getBaseURI ( ) . re... | Post an object to Smartsheet REST API and receive a list of objects from response . | 335 | 18 |
14,665 | protected CopyOrMoveRowResult postAndReceiveRowObject ( String path , CopyOrMoveRowDirective objectToPost ) throws SmartsheetException { Util . throwIfNull ( path , objectToPost ) ; Util . throwIfEmpty ( path ) ; HttpRequest request = createHttpRequest ( smartsheet . getBaseURI ( ) . resolve ( path ) , HttpMethod . POS... | Post an object to Smartsheet REST API and receive a CopyOrMoveRowResult object from response . | 313 | 21 |
14,666 | public < T > Attachment attachFile ( String url , T t , String partName , InputStream inputstream , String contentType , String attachmentName ) throws SmartsheetException { Util . throwIfNull ( inputstream , contentType ) ; Attachment attachment = null ; final String boundary = "----" + System . currentTimeMillis ( ) ... | Create a multipart upload request . | 389 | 7 |
14,667 | @ Deprecated // replace with StreamUtil.copyContentIntoOutputStream() private static void copyStream ( InputStream input , OutputStream output ) throws IOException { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int len ; while ( ( len = input . read ( buffer ) ) != - 1 ) { output . write ( buffer , 0 , len ) ; } } | Copy stream . | 82 | 3 |
14,668 | public PagedResult < Share > listShares ( long objectId , PaginationParameters pagination ) throws SmartsheetException { return this . listShares ( objectId , pagination , false ) ; } | List shares of a given object . | 42 | 7 |
14,669 | public Share getShare ( long objectId , String shareId ) throws SmartsheetException { return this . getResource ( getMasterResourceType ( ) + "/" + objectId + "/shares/" + shareId , Share . class ) ; } | Get a Share . | 52 | 4 |
14,670 | public List < Share > shareTo ( long objectId , List < Share > shares , Boolean sendEmail ) throws SmartsheetException { String path = getMasterResourceType ( ) + "/" + objectId + "/shares" ; if ( sendEmail != null ) { path += "?sendEmail=" + sendEmail ; } return this . postAndReceiveList ( path , shares , Share . clas... | Shares the object with the specified Users and Groups . | 88 | 10 |
14,671 | public void deleteShare ( long objectId , String shareId ) throws SmartsheetException { this . deleteResource ( getMasterResourceType ( ) + "/" + objectId + "/shares/" + shareId , Share . class ) ; } | Delete a share . | 51 | 4 |
14,672 | public ReportPublish updatePublishStatus ( long id , ReportPublish reportPublish ) throws SmartsheetException { return this . updateResource ( "reports/" + id + "/publish" , ReportPublish . class , reportPublish ) ; } | Sets the publish status of a report and returns the new status including the URLs of any enabled publishing . | 54 | 21 |
14,673 | public PagedResult < SheetFilter > listFilters ( long sheetId , PaginationParameters pagination ) throws SmartsheetException { String path = "sheets/" + sheetId + "/filters" ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( pagination != null ) { parameters = pagination . toHashMap (... | Get all filters . | 115 | 4 |
14,674 | public PagedResult < Sight > listSights ( PaginationParameters paging , Date modifiedSince ) throws SmartsheetException { String path = "sights" ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( paging != null ) { parameters = paging . toHashMap ( ) ; } if ( modifiedSince != null ) {... | Gets the list of all Sights where the User has access . | 162 | 14 |
14,675 | public Sight getSight ( long sightId , Integer level ) throws SmartsheetException { String path = "sights/" + sightId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; if ( level != null ) { parameters . put ( "level" , level ) ; } path += QueryUtil . generateUrl ( null , parameters ) ; r... | Get a specified Sight . | 97 | 5 |
14,676 | public Sight updateSight ( Sight sight ) throws SmartsheetException { Util . throwIfNull ( sight ) ; return this . updateResource ( "sights/" + sight . getId ( ) , Sight . class , sight ) ; } | Update a specified Sight . | 51 | 5 |
14,677 | public SightPublish setPublishStatus ( long sightId , SightPublish sightPublish ) throws SmartsheetException { Util . throwIfNull ( sightPublish ) ; return this . updateResource ( "sights/" + sightId + "/publish" , SightPublish . class , sightPublish ) ; } | Sets the publish status of a Sight and returns the new status including the URLs of any enabled publishing . | 69 | 21 |
14,678 | public PagedResult < Template > listUserCreatedTemplates ( PaginationParameters parameters ) throws SmartsheetException { String path = "templates" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Template . class ) ; } | List user - created templates . | 67 | 6 |
14,679 | public Folder getFolder ( long folderId , EnumSet < SourceInclusion > includes ) throws SmartsheetException { String path = "folders/" + folderId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , QueryUtil . generateCommaSeparatedList ( includes ) ) ; path +... | Get a folder . | 108 | 4 |
14,680 | public Folder updateFolder ( Folder folder ) throws SmartsheetException { return this . updateResource ( "folders/" + folder . getId ( ) , Folder . class , folder ) ; } | Update a folder . | 40 | 4 |
14,681 | public PagedResult < Folder > listFolders ( long parentFolderId , PaginationParameters parameters ) throws SmartsheetException { String path = "folders/" + parentFolderId + "/folders" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Folder . class ... | List child folders of a given folder . | 80 | 8 |
14,682 | public Folder createFolder ( long parentFolderId , Folder folder ) throws SmartsheetException { return this . createResource ( "folders/" + parentFolderId + "/folders" , Folder . class , folder ) ; } | Create a folder . | 47 | 4 |
14,683 | public Folder moveFolder ( long folderId , ContainerDestination containerDestination ) throws SmartsheetException { String path = "folders/" + folderId + "/move" ; return this . createResource ( path , Folder . class , containerDestination ) ; } | Moves the specified Folder to another location . | 55 | 9 |
14,684 | public SearchResult searchSheet ( long sheetId , String query ) throws SmartsheetException { Util . throwIfNull ( query ) ; Util . throwIfEmpty ( query ) ; try { return this . getResource ( "search/sheets/" + sheetId + "?query=" + URLEncoder . encode ( query , "utf-8" ) , SearchResult . class ) ; } catch ( UnsupportedE... | Performs a search within a sheet . | 105 | 8 |
14,685 | public Attachment attachUrl ( long sheetId , Attachment attachment ) throws SmartsheetException { return this . createResource ( "sheets/" + sheetId + "/attachments" , Attachment . class , attachment ) ; } | Attach a URL to a sheet . | 47 | 7 |
14,686 | public PagedResult < Attachment > listAttachments ( long sheetId , PaginationParameters parameters ) throws SmartsheetException { String path = "sheets/" + sheetId + "/attachments" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Attachment . class... | Gets a list of all Attachments that are on the Sheet including Sheet Row and Discussion level Attachments . | 78 | 24 |
14,687 | public OAuthFlow build ( ) { if ( httpClient == null ) { httpClient = new DefaultHttpClient ( ) ; } if ( tokenURL == null ) { tokenURL = DEFAULT_TOKEN_URL ; } if ( authorizationURL == null ) { authorizationURL = DEFAULT_AUTHORIZATION_URL ; } if ( jsonSerializer == null ) { jsonSerializer = new JacksonJsonSerializer ( )... | Build the OAuthFlow instance . | 151 | 7 |
14,688 | public Folder createFolder ( long workspaceId , Folder folder ) throws SmartsheetException { return this . createResource ( "workspaces/" + workspaceId + "/folders" , Folder . class , folder ) ; } | Create a folder in the workspace . | 45 | 7 |
14,689 | public List < Favorite > addFavorites ( List < Favorite > favorites ) throws SmartsheetException { return this . postAndReceiveList ( "favorites/" , favorites , Favorite . class ) ; } | Adds one or more items to the user s list of Favorite items . | 45 | 14 |
14,690 | public PagedResult < Favorite > listFavorites ( PaginationParameters parameters ) throws SmartsheetException { String path = "favorites" ; if ( parameters != null ) { path += parameters . toQueryString ( ) ; } return this . listResourcesWithWrapper ( path , Favorite . class ) ; } | Gets a list of all of the user s Favorite items . | 67 | 13 |
14,691 | public static < T > String generateCommaSeparatedList ( Collection < T > list ) { if ( list == null || list . size ( ) == 0 ) { return "" ; } StringBuilder result = new StringBuilder ( ) ; for ( Object obj : list ) { result . append ( ' ' ) . append ( obj . toString ( ) ) ; } return result . length ( ) == 0 ? "" : resu... | Returns a comma seperated list of items as a string | 97 | 12 |
14,692 | protected static String generateQueryString ( Map < String , Object > parameters ) { if ( parameters == null || parameters . size ( ) == 0 ) { return "" ; } StringBuilder result = new StringBuilder ( ) ; try { for ( Map . Entry < String , Object > entry : parameters . entrySet ( ) ) { // Check to see if the key/value i... | Returns a query string . | 235 | 5 |
14,693 | @ JsonIgnore public static Message errorMessage ( String detailMessage ) { Message message = new Message ( ) ; message . setDetailMessage ( detailMessage ) ; message . setSeverity ( "ERROR" ) ; message . setType ( "" ) ; return message ; } | Returns a Message with Severity set to ERROR and the detailMessage set to what is passed in . | 59 | 20 |
14,694 | @ JsonAnySetter public void handleJsonArrayToJavaString ( String name , Object value ) { try { PropertyUtils . setProperty ( this , name , this . convertListToString ( value ) ) ; } catch ( IllegalAccessException e ) { log . debug ( "Error setting field " + name + " with value " + value + " on entity " + this . getClas... | Unknown properties are handled here . One main purpose of this method is to handle String values that are sent as json arrays if configured as multi - values in bh . | 231 | 33 |
14,695 | public String convertListToString ( Object listOrString ) { if ( listOrString == null ) { return null ; } if ( listOrString instanceof Collection ) { List < String > list = ( List < String > ) listOrString ; return StringUtils . join ( list , "," ) ; } return listOrString . toString ( ) ; } | Handles the fact that bh rest api sends Strings as json arrays if they are setup as multipickers in the fieldmaps . | 77 | 27 |
14,696 | private ObjectMapper createObjectMapper ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; mapper . registerModule ( new JodaModule ( ) ) ; mapper . configure ( SerializationFeature . INDENT_OUTPUT , true ) ; return mapper ; } | Create the ObjectMapper that deserializes entity to json String . | 62 | 14 |
14,697 | public < T > T jsonToEntityUnwrapRoot ( String jsonString , Class < T > type ) { return jsonToEntity ( jsonString , type , this . objectMapperWrapped ) ; } | Converts a jsonString to an object of type T . Unwraps from root most often this means that the data tag is ignored and that the entity is created from within that data tag . | 43 | 39 |
14,698 | public < T extends BullhornEntity > String convertEntityToJsonString ( T entity ) { String jsonString = "" ; try { jsonString = objectMapperStandard . writeValueAsString ( entity ) ; } catch ( JsonProcessingException e ) { log . error ( "Error deserializing entity of type" + entity . getClass ( ) + " to jsonString." , ... | Takes a BullhornEntity and converts it to a String in json format . | 91 | 16 |
14,699 | public Map < String , String > getUriVariablesForEntity ( BullhornEntityInfo entityInfo , Integer id , Set < String > fieldSet , EntityParams params ) { if ( params == null ) { params = ParamFactory . entityParams ( ) ; } Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables... | Returns the uri variables needed for an entity GET | 127 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.