Package odata.msgraph.client.entity
Class FileAttachment
- java.lang.Object
-
- odata.msgraph.client.entity.Entity
-
- odata.msgraph.client.entity.Attachment
-
- odata.msgraph.client.entity.FileAttachment
-
- All Implemented Interfaces:
com.github.davidmoten.odata.client.ODataEntityType,com.github.davidmoten.odata.client.ODataType
public class FileAttachment extends Attachment implements com.github.davidmoten.odata.client.ODataEntityType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileAttachment.Builder
-
Field Summary
Fields Modifier and Type Field Description protected byte[]contentBytesprotected StringcontentIdprotected StringcontentLocation-
Fields inherited from class odata.msgraph.client.entity.Attachment
contentType, isInline, lastModifiedDateTime, name, size
-
Fields inherited from class odata.msgraph.client.entity.Entity
changedFields, contextPath, id, odataType, unmappedFields
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFileAttachment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileAttachment.BuilderbuilderFileAttachment()Returns a builder which is used to create a new instance of this class (given that this class is immutable).com.github.davidmoten.odata.client.internal.ChangedFieldsgetChangedFields()Optional<byte[]>getContentBytes()Optional<String>getContentId()Optional<String>getContentLocation()Optional<com.github.davidmoten.odata.client.StreamProvider>getStream()If suitable metadata found a StreamProvider is returned otherwise returnsOptional.empty().com.github.davidmoten.odata.client.UnmappedFieldsgetUnmappedFields()StringodataTypeName()FileAttachmentpatch()Submits only changed fields for update and returns an immutable copy ofthiswith changed fields reset.voidpostInject(boolean addKeysToContextPath)FileAttachmentput()Submits all fields for update and returns an immutable copy ofthiswith changed fields reset (they were ignored anyway).StringtoString()FileAttachmentwithContentBytes(byte[] contentBytes)FileAttachmentwithContentId(String contentId)FileAttachmentwithContentLocation(String contentLocation)FileAttachmentwithUnmappedField(String name, Object value)-
Methods inherited from class odata.msgraph.client.entity.Attachment
getContentType, getIsInline, getLastModifiedDateTime, getName, getSize, withContentType, withIsInline, withLastModifiedDateTime, withName, withSize
-
-
-
-
Method Detail
-
odataTypeName
public String odataTypeName()
- Specified by:
odataTypeNamein interfacecom.github.davidmoten.odata.client.ODataType- Overrides:
odataTypeNamein classAttachment
-
builderFileAttachment
public static FileAttachment.Builder builderFileAttachment()
Returns a builder which is used to create a new instance of this class (given that this class is immutable).- Returns:
- a new Builder for this class
-
getChangedFields
public com.github.davidmoten.odata.client.internal.ChangedFields getChangedFields()
- Specified by:
getChangedFieldsin interfacecom.github.davidmoten.odata.client.ODataEntityType- Overrides:
getChangedFieldsin classAttachment
-
postInject
public void postInject(boolean addKeysToContextPath)
- Specified by:
postInjectin interfacecom.github.davidmoten.odata.client.ODataType- Overrides:
postInjectin classAttachment
-
getContentBytes
public Optional<byte[]> getContentBytes()
-
withContentBytes
public FileAttachment withContentBytes(byte[] contentBytes)
-
withContentId
public FileAttachment withContentId(String contentId)
-
withContentLocation
public FileAttachment withContentLocation(String contentLocation)
-
withUnmappedField
public FileAttachment withUnmappedField(String name, Object value)
- Overrides:
withUnmappedFieldin classAttachment
-
getUnmappedFields
public com.github.davidmoten.odata.client.UnmappedFields getUnmappedFields()
- Specified by:
getUnmappedFieldsin interfacecom.github.davidmoten.odata.client.ODataType- Overrides:
getUnmappedFieldsin classAttachment
-
getStream
public Optional<com.github.davidmoten.odata.client.StreamProvider> getStream()
If suitable metadata found a StreamProvider is returned otherwise returnsOptional.empty(). Normally for a stream to be available this entity needs to have been hydrated with full metadata. Consider calling the builder method.metadataFull()when getting this instance (either directly or as part of a collection).- Returns:
- StreamProvider if suitable metadata found otherwise returns
Optional.empty()
-
patch
public FileAttachment patch()
Submits only changed fields for update and returns an immutable copy ofthiswith changed fields reset.- Overrides:
patchin classAttachment- Returns:
- a copy of
thiswith changed fields reset - Throws:
com.github.davidmoten.odata.client.ClientException- if HTTP response is not as expected
-
put
public FileAttachment put()
Submits all fields for update and returns an immutable copy ofthiswith changed fields reset (they were ignored anyway).- Overrides:
putin classAttachment- Returns:
- a copy of
thiswith changed fields reset - Throws:
com.github.davidmoten.odata.client.ClientException- if HTTP response is not as expected
-
toString
public String toString()
- Overrides:
toStringin classAttachment
-
-