Page tree
Skip to end of metadata
Go to start of metadata

The "spaces" query returns a collection of Spaces the user or application has access to. The query can accept various attributes of pagination options from the BasicPaginationEnum.

The org.opencode4workspace.builders.SpacesGraphQLQuery class has a simple static helper method, buildStandardGetSpacesQuery(). Similar methods are also available from WWClient and WWGraphQLEndpoint.

For greater control, create an ObjectDataSenderBuilder for the Space.SPACES_QUERY_OBJECT_NAME object, adding attributes, passing in Space fields and children. Instantiate a new SpacesGraphQLQuery passing in the ObjectDataSenderBuilder as the parameter. Then pass this to WWClient.getSpacesWithQuery(). Sonce 0.8.0 you can also pass this to WWClient.getSpacesContainerWithQuery(). The first one just returns the List of Space objects, the second one gives access to the SpacesContainer, which gives access to the PageInfo object and the List of Space objects.

Examples

Basic getSpaces
    List<? extends Space> spaces = client.getSpaces();
getSpacesWithQuery
    ObjectDataSenderBuilder spaces = new ObjectDataSenderBuilder(Space.SPACES_QUERY_OBJECT_NAME, true);
    spaces.addAttribute(BasicPaginationEnum.FIRST, 100);
    spaces.addPageInfo();
    spaces.addField(SpaceFields.ID);
    spaces.addField(SpaceFields.TITLE);
    spaces.addField(SpaceFields.DESCRIPTION);
    spaces.addField(SpaceFields.UPDATED);
    spaces.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(SpaceChildren.UPDATED_BY));
    spaces.addField(SpaceFields.CREATED);
    spaces.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(SpaceChildren.CREATED_BY));
    ObjectDataSenderBuilder members = new ObjectDataSenderBuilder(SpaceChildren.MEMBERS.getLabel(), true);
    members.addAttribute(BasicPaginationEnum.FIRST, 10);
    members.addField(PersonFields.ID);
    members.addField(PersonFields.PHOTO_URL);
    members.addField(PersonFields.EMAIL);
    members.addField(PersonFields.DISPLAY_NAME);
    spaces.addChild(members);
    List<? extends Space> spacesResult = client.getSpacesWithQuery(new SpacesGraphQLQuery(spaces));
    assert (spacesResult.size() > 0);
getSpacesContainerWithQuery - since 0.8.0
    ObjectDataSenderBuilder spaces = new ObjectDataSenderBuilder(Space.SPACES_QUERY_OBJECT_NAME, true);
    spaces.addAttribute(BasicPaginationEnum.FIRST, 10);
    spaces.addPageInfo();
    spaces.addField(SpaceFields.ID);
    spaces.addField(SpaceFields.TITLE);
    spaces.addField(SpaceFields.DESCRIPTION);
    spaces.addField(SpaceFields.UPDATED);
    spaces.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(SpaceChildren.UPDATED_BY));
    spaces.addField(SpaceFields.CREATED);
    spaces.addChild(new BasicCreatedByUpdatedByDataSenderBuilder(SpaceChildren.CREATED_BY));
    ObjectDataSenderBuilder members = new ObjectDataSenderBuilder(SpaceChildren.MEMBERS.getLabel(), true);
    members.addAttribute(BasicPaginationEnum.FIRST, 10);
    members.addField(PersonFields.ID);
    members.addField(PersonFields.PHOTO_URL);
    members.addField(PersonFields.EMAIL);
    members.addField(PersonFields.DISPLAY_NAME);
    spaces.addChild(members);
    SpacesContainer spacesResult = client.getSpacesContainerWithQuery(new SpacesGraphQLQuery(spaces));
    assert spacesResult.getPageInfo().isHasNextPage();
    assert (spacesResult.getItems().size() > 0);

10 Comments

  1. Anonymous

    this is Java API and used class spacesgraphQLQuery implement on the interface of Serializable, IGraphQLQuery.
    public class SpacesGraphQLQuery
    extends BaseGraphQLQuery
    Since:
    0.5.0 Object for creating a Spaces query. The only attributes available are from BasicPaginationEnum.
    Author:
    Paul Withers.
    Also there are two classes that you cam use it,
    1- nested class:
    static class SpacesGraphQLQuery.SpacesAttributes
    2- Constructor class:
    SpacesGraphQLQuery()
    Creates a Spaces query with a blank ObjectDataSenderBuilder query object
    SpacesGraphQLQuery(ObjectDataSenderBuilder query)
    Creates a Spaces query with a pre-populated ObjectDataSenderBuilder query object

    information was given by cheap reliable essay writing service thankyou in advance. 

  2. Anonymous

    I strongly propose that novices steer clean of astrophotography till they've discovered their manner around the sky. Astrophotography is by means of a ways the maximum pricey and tough vicinity of amateur astronomy. buy assignment

  3. Anonymous

    In the present serious scene, time is everything. Individuals follow an exacting calendar invest their energy carefully. Thus, on the off chance that you have recruited a help that isn't prompt, you are essentially burning through your time on them.  home cleaning services

  4. Anonymous

    Keeping in see clients fulfillment and appropriateness, we have offering types of assistance in three classes economy, premium and extravagance. You can get in touch with us by simply single call, our fiery staff will cause you to feel that how significant you are for us.  Rent a car in Lahore

  5. Anonymous

    Our basic qualities are dedication, satisfaction and genuineness which causes us to become advertise pioneer in rental vehicle administration.

    honda brv for rent in Karachi

  6. Anonymous

    Our Freezer Vans can store various kinds of things at precisely the necessary temperature since they have a propelled Cooling System. We have workplaces all over Dubai, Sharjah, Abu Dhabi, Al Quwain, Ajman, Umm Ras Al Khaimah, Fujairah and have cold vehicle and rental chilled administrations. Regardless of whether you need chiller or cooler trucks, we have you secured!  Refrigerated truck for rent in Abu Dhabi

  7. Anonymous

    Start up another SpacesGraphQLQuery going in the ObjectDataSenderBuilder as the parameter. 

    At that point pass this to WWClient.getSpacesWithQuery(). Sonce 0.8.0 you can likewise pass this to WWClient.getSpacesContainerWithQuery(). The first just returns the Rundown of Room questions, the subsequent one offers access to the SpacesContainer

  8. Anonymous

    Start up another SpacesGraphQLQuery going in the ObjectDataSenderBuilder as the parameter. <a href='Homework'>https://www.prohomeworkhelp.com/homework-writing-service.php'>Homework Assignment Writing Service</a> At that point pass this to WWClient.getSpacesWithQuery(). Sonce 0.8.0 you can likewise pass this to WWClient.getSpacesContainerWithQuery(). The first just returns the Rundown of Room questions, the subsequent one offers access to the SpacesContainer

  9. Anonymous

    Start up another SpacesGraphQLQuery going in the ObjectDataSenderBuilder as the parameter. <a href='https://www.prohomeworkhelp.com/homework-writing-service.php'>Homework Assignment Writing Service</a> At that point pass this to WWClient.getSpacesWithQuery(). Sonce 0.8.0 you can likewise pass this to WWClient.getSpacesContainerWithQuery(). The first just returns the Rundown of Room questions, the subsequent one offers access to the SpacesContainer

Write a comment…